Skip to content

Instantly share code, notes, and snippets.

@rbrooks
Last active January 17, 2017 22:48
Show Gist options
  • Save rbrooks/44e284f71891cf186218d286ec194ce9 to your computer and use it in GitHub Desktop.
Save rbrooks/44e284f71891cf186218d286ec194ce9 to your computer and use it in GitHub Desktop.
Custom Log Level in Python
logging.addLevelName(51, 'AUTH')
log = logging.getLogger()
# log.setLevel(10)
print log.level
print log.getEffectiveLevel()
log.log(10, '********** 10 ************')
log.log(20, '********** 20 ************')
log.log(30, '********** 30 ************')
log.log(40, '********** 40 ************')
log.log(50, '********** 50 ************')
log.log(51, '********** 51 ************')
log.info('INFO!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment