Skip to content

logging: Surprising call to basicConfig() #92859

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

Closed
Gaasmann opened this issue May 16, 2022 · 2 comments
Closed

logging: Surprising call to basicConfig() #92859

Gaasmann opened this issue May 16, 2022 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@Gaasmann
Copy link
Contributor

Documentation

Hello,

I just got surprised by a behavior of the logging module where a call to logging.debug() (or any level) will call basicConfig() if no handler is set on the root logger but a call to Logger.debug() won't.

This issue was already discussed on #79711 and therefore, I would not discuss the behavior itself. Rather, I am wondering if the documentation displays this behavior enough. I agree that it is documented, but I think this is still misleading because:

If people agree that this is an issue, I would propose that I make a PR to add a paragraph to logging.debug() to describe the behavior.

Let me know what you think!

Thanks

@Gaasmann Gaasmann added the docs Documentation in the Doc dir label May 16, 2022
@vsajip
Copy link
Member

vsajip commented May 17, 2022

would propose that I make a PR to add a paragraph to logging.debug() to describe the behavior

Yes, that's fine, and perhaps you should also add a paragraph in the "Basic Tutorial"'s "A simple example" section, adding not much detail (as it's an introductory section) but perhaps just a mention of :func:basicConfig() ?

@Gaasmann
Copy link
Contributor Author

Sure thing, I'll make a PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Development

No branches or pull requests

2 participants