Created
April 26, 2017 09:35
-
-
Save gianrubio/4c7d31c972862b70f737b67c11de3a1d to your computer and use it in GitHub Desktop.
python console logger
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 | |
import time | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
ch = logging.StreamHandler(sys.stdout) | |
ch.setFormatter(logging.Formatter("%(levelname)s %(asctime)s %(funcName)s %(lineno)d %(message)s")) | |
logger.addHandler(ch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment