Skip to content

Instantly share code, notes, and snippets.

@atsuoishimoto
Last active October 9, 2018 09:22
Show Gist options
  • Save atsuoishimoto/c0a8464ee4147ebdc71854b72305337d to your computer and use it in GitHub Desktop.
Save atsuoishimoto/c0a8464ee4147ebdc71854b72305337d to your computer and use it in GitHub Desktop.
import logging
logger = logging.getLogger('xxx')
logging.lastResort.setLevel(logging.DEBUG) # <<<<<< コレ!
for lvl in (logging.DEBUG, logging.INFO,
logging.WARNING, logging.ERROR, logging.CRITICAL):
logger.setLevel(lvl)
print(logger.level)
logger.debug('debug')
logger.info('info')
logger.warning('warning')
logger.error('error')
logger.critical('critical')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment