Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use setup_logger in content_generator.py #186

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

druce
Copy link

@druce druce commented Nov 18, 2024

Was having trouble with adding some logging in content_generator.py

I think it should use setup_logger to use same config.yaml settings as client.py, anyway not sure why they should be different.

Anyway after making the change I can add logger.debug statements in content_generator.py and they work as expected.

@souzatharsis
Copy link
Owner

@druce I am afraid it is not best practice to use two different logging packages in the same project.

@druce
Copy link
Author

druce commented Nov 25, 2024 via email

@druce
Copy link
Author

druce commented Nov 25, 2024

possibly the reason I didn't get debug messages as expected was, I turned on debug in the config.yaml, but any files that didn't use setup_logger() don't read the YAML log param. so had default debug level.

so one solution was to use setup_logger for all logging ... seemed similar to instantiating logger in each file, except it uses the same methodology and reads the config.yaml, didn't see why client.py does it one way and other files do it the other ... although I could see maybe never want users to affect logging level and see debug messages in those files, only want devs to set level in the code while debugging.

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.

2 participants