Root logger doesn't log when (I think) it should:
import logging
# NOTE: I make sure to set the root logger level to logging.DEBUG
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
logging.debug('This is a debugging test.')
From my understanding this should log something but it does nothing. Quick Google searches didn't help me to figure this issue out, neither did the official documentation.
In the other hand, if I use logging.warning
instead of logging.debug
, it does work.
What am I doing wrong?
EDIT:
Checking the current level with logging.getLogger().getEffectiveLevel()
indicates me that the level is still at 30
, like before the call of logging.basicConfig
.
Checking logging.getLogger().isEnabledFor(logging.DEBUG)
effectively tells me that the root logger level isn't enabled for logging.DEBUG
.