Created
May 3, 2017 02:06
-
-
Save limkopii/15f3dc37dc33cb83c1a2c402df0edc11 to your computer and use it in GitHub Desktop.
Python Logging Setup
This file contains 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
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