Skip to content

Instantly share code, notes, and snippets.

@SecurityForUs
Created October 9, 2012 18:29
Show Gist options
  • Save SecurityForUs/3860550 to your computer and use it in GitHub Desktop.
Save SecurityForUs/3860550 to your computer and use it in GitHub Desktop.
logging
conf['system']['log_level'] = "debug,info"
try:
conf_level = conf['system']['log_level'].split(",")
LEVELS = { "debug" : logging.DEBUG, "info" : logging.INFO, "warning" : logging.WARNING, "error" : logging.ERROR, "critical" : logging.CRITICAL}
for level in conf_level:
self.log.setLevel(LEVELS[level])
except:
self.log.setLevel(logging.ERROR)
self.log.Debug("debug msg")
self.log.Info("info msg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment