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

Improve Logging with named logger #24

Closed
twitter-79 opened this issue May 11, 2022 · 5 comments
Closed

Improve Logging with named logger #24

twitter-79 opened this issue May 11, 2022 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@twitter-79
Copy link
Contributor

firstly: thanks for providing this nice API!

I would like to use it in a small project but the INFO logs are spamming quite much.
Could you use a named logger instead of the root logger? For example by setting the logger in the api module like:
logger = logging.getLogger(__name__)
and consecutively using logger.INFO("awesome log") instead of logging.INFO(...)

This would enable users of your library to override the log level by using:
logging.getLogger("gogettr").setLevel(logging.WARNING)

@milesmcc
Copy link
Collaborator

Sure, that's fine by me. I'm currently a bit busy with other projects, but I'd welcome a PR with this change.

@milesmcc milesmcc added the help wanted Extra attention is needed label May 11, 2022
@twitter-79
Copy link
Contributor Author

I opened a PR with the changes but the test cases don't work. To me it seems unrelated to the logging functionality though. It seems that Gettr changed something on their side. E.g. the 'infl' value on the Support Profile.
Guess the tests should not be fixed in an unrelated PR though?

@milesmcc
Copy link
Collaborator

Yep, you're right. I'll take a look at the tests then we can rebase.

@twitter-79
Copy link
Contributor Author

tests are working fine now, thanks!

@milesmcc
Copy link
Collaborator

Thanks! Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants