Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I believe log levels work globally in Python if you set them with logging.basicConfig.

The simplest answer is probably (as jake77 suggested alreadyas jake77 suggested already):

logger = logging.getLogger(__name__) 

Then set the level on that logger specifically:

logger.setLevel(logging.DEBUG) # or whichever 

There's a good article on best practices with logging here. It may or may not be relevant to your case, but the best piece of advice it gives is that

[...] libraries have no business configuring logging levels, formatters, or handlers.

There's also a good answer herehere.

I believe log levels work globally in Python if you set them with logging.basicConfig.

The simplest answer is probably (as jake77 suggested already):

logger = logging.getLogger(__name__) 

Then set the level on that logger specifically:

logger.setLevel(logging.DEBUG) # or whichever 

There's a good article on best practices with logging here. It may or may not be relevant to your case, but the best piece of advice it gives is that

[...] libraries have no business configuring logging levels, formatters, or handlers.

There's also a good answer here.

I believe log levels work globally in Python if you set them with logging.basicConfig.

The simplest answer is probably (as jake77 suggested already):

logger = logging.getLogger(__name__) 

Then set the level on that logger specifically:

logger.setLevel(logging.DEBUG) # or whichever 

There's a good article on best practices with logging here. It may or may not be relevant to your case, but the best piece of advice it gives is that

[...] libraries have no business configuring logging levels, formatters, or handlers.

There's also a good answer here.

add link to useful SO answer
Source Link
Leo
  • 1.1k
  • 11
  • 25

I believe log levels work globally in Python if you set them with logging.basicConfig.

The simplest answer is probably (as jake77 suggested already):

logger = logging.getLogger(__name__) 

Then set the level on that logger specifically:

logger.setLevel(logging.DEBUG) # or whichever 

There's a good article on best practices with logging here. It may or may not be relevant to your case, but the best piece of advice it gives is that

[...] libraries have no business configuring logging levels, formatters, or handlers.

There's also a good answer here.

I believe log levels work globally in Python if you set them with logging.basicConfig.

The simplest answer is probably (as jake77 suggested already):

logger = logging.getLogger(__name__) 

Then set the level on that logger specifically:

logger.setLevel(logging.DEBUG) # or whichever 

There's a good article on best practices with logging here. It may or may not be relevant to your case, but the best piece of advice it gives is that

[...] libraries have no business configuring logging levels, formatters, or handlers.

I believe log levels work globally in Python if you set them with logging.basicConfig.

The simplest answer is probably (as jake77 suggested already):

logger = logging.getLogger(__name__) 

Then set the level on that logger specifically:

logger.setLevel(logging.DEBUG) # or whichever 

There's a good article on best practices with logging here. It may or may not be relevant to your case, but the best piece of advice it gives is that

[...] libraries have no business configuring logging levels, formatters, or handlers.

There's also a good answer here.

Source Link
Leo
  • 1.1k
  • 11
  • 25

I believe log levels work globally in Python if you set them with logging.basicConfig.

The simplest answer is probably (as jake77 suggested already):

logger = logging.getLogger(__name__) 

Then set the level on that logger specifically:

logger.setLevel(logging.DEBUG) # or whichever 

There's a good article on best practices with logging here. It may or may not be relevant to your case, but the best piece of advice it gives is that

[...] libraries have no business configuring logging levels, formatters, or handlers.