Skip to content

Conversation

@neil-sola
Copy link

@neil-sola neil-sola commented Feb 29, 2024

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

Refer to #211

@okhat
Copy link
Collaborator

okhat commented Mar 1, 2024

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

@neil-sola
Copy link
Author

neil-sola commented Mar 1, 2024

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 neil-sola changed the title Fix: Only initialize logging for OpenAI usage if log_openai_usage is set Fix: Add logging path modification for OpenAI usage Mar 1, 2024
@neil-sola
Copy link
Author

@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.

@KCaverly
Copy link
Collaborator

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

@neild0
Copy link

neild0 commented Mar 21, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants