Last active
January 17, 2017 22:48
-
-
Save rbrooks/44e284f71891cf186218d286ec194ce9 to your computer and use it in GitHub Desktop.
Custom Log Level in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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