Skip to content

Instantly share code, notes, and snippets.

@jk0
Created December 16, 2010 16:59
Show Gist options
  • Save jk0/743648 to your computer and use it in GitHub Desktop.
Save jk0/743648 to your computer and use it in GitHub Desktop.
import logging
def logger(name, debug=False):
"""Log handler"""
logging.basicConfig(
level=logging.DEBUG if debug else logging.INFO,
format="%(asctime)s [%(name)s] %(message)s",
datefmt="%H:%M:%S")
return logging.getLogger(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment