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 package logger instead of root logger #179

Closed
Agno94 opened this issue Oct 17, 2023 · 4 comments · Fixed by #180
Closed

Use package logger instead of root logger #179

Agno94 opened this issue Oct 17, 2023 · 4 comments · Fixed by #180

Comments

@Agno94
Copy link

Agno94 commented Oct 17, 2023

The problem we've experienced

We've selected this library to implement Raft in an existing project. We experienced some problem because we have a log parser and this package uses the root logger of the logging module, which cannot/should not be replaced.

For example in dns_resolve.py the function logging.warning is used twice.

We resolved our problem suppressing log from the root logger and forcing propagate=False. But this is not ideal. We miss everything logged by this package.

Solution

This package should create and use its own instance of logging.Logger and used it instead of the root logger.

Usage of the python root logger should be limited to small standalone code only.

@zangico
Copy link

zangico commented Oct 17, 2023

Good point, +1

@bakwc
Copy link
Owner

bakwc commented Oct 17, 2023

would be cool if someone prepare PR..

@weii41392
Copy link
Contributor

Hi, can I work on this?

@bakwc
Copy link
Owner

bakwc commented Oct 23, 2023

Hi, can I work on this?

Sure!

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

Successfully merging a pull request may close this issue.

4 participants