Closed dum3ng closed 4 years ago
When using the logging library, directly use the logger.setLevel does not work:
logging
logger.setLevel
import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logger.debug('debug info')
The debug message will not be logged to stdout.
Call logging.basicConfig first:
logging.basicConfig
logging.basicConfig(level=logging.INFO) # set any level logger.setLevel(logging.DEBUG)
When using the
logging
library, directly use thelogger.setLevel
does not work:The debug message will not be logged to stdout.
solution
Call
logging.basicConfig
first: