Skip to content

Instantly share code, notes, and snippets.

@limkopii
Created May 3, 2017 02:06
Show Gist options
  • Save limkopii/15f3dc37dc33cb83c1a2c402df0edc11 to your computer and use it in GitHub Desktop.
Save limkopii/15f3dc37dc33cb83c1a2c402df0edc11 to your computer and use it in GitHub Desktop.
Python Logging Setup
import logging
log = logging.getLogger(__file__)
log.setLevel(logging.DEBUG)
formatter = logging.Formatter(('#%(lineno)s,%(levelname)s,"%(message)s"'))
c = logging.StreamHandler()
c.setFormatter(formatter)
c.setLevel(logging.DEBUG)
log.addHandler(c)
log.info("hello world")
log.debug("hello world")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment