Skip to content

Instantly share code, notes, and snippets.

@setomits
Created October 9, 2018 08:56
Show Gist options
  • Save setomits/dda1b9fa6b58b1cd0a0fa274c2aea161 to your computer and use it in GitHub Desktop.
Save setomits/dda1b9fa6b58b1cd0a0fa274c2aea161 to your computer and use it in GitHub Desktop.
import logging
logger = logging.getLogger('xxx')
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