dspy icon indicating copy to clipboard operation
dspy copied to clipboard

Fix: Add logging path modification for OpenAI usage

Open neil-sola opened this issue 11 months ago • 3 comments

This is to ensure that extraneous files are created in specified folder.

Refer to #211

neil-sola avatar Feb 29 '24 20:02 neil-sola

Thanks a lot. I think this may not work because it will not allow the user to ever turn on the cache after import?

okhat avatar Mar 01 '24 03:03 okhat

Hmm, I see. What are your opinions of using an env_var here: either to prefix the logging files to a specific folder, or to enable/disable?

I was thinking maybe something like DSPY_USAGE_LOGGING_DIR to prefix a folder to save logs, or DSPY_USAGE_LOGGING to enable/disable logging.

neil-sola avatar Mar 01 '24 03:03 neil-sola

@okhat I updated the PR to focus on just giving the user the ability to specify a folder to save logs to — the mechanism to allow enabling/disabling of logging seems more complicated, but this should provide some level on configurability on where logs are stored.

neil-sola avatar Mar 01 '24 03:03 neil-sola

I've added an initial global logger, with configuration here: #684. Does the API offered in that PR, cover all the uses outlined here?

KCaverly avatar Mar 21 '24 21:03 KCaverly

I've added an initial global logger, with configuration here: #684. Does the API offered in that PR, cover all the uses outlined here?

Yup, looks perfect — thanks so much!

neild0 avatar Mar 21 '24 21:03 neild0