Created
August 14, 2017 03:46
-
-
Save dangsonbk/6e1949bf2f0df6557769a37c21d6bfa4 to your computer and use it in GitHub Desktop.
Python logging basic config format
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 | |
logging.basicConfig(level=logging.DEBUG, format=( '%(levelname)s:\t' | |
'%(filename)s:' | |
'%(funcName)s():' | |
'%(lineno)d\t' | |
'%(message)s' | |
) | |
) | |
# logging.basicConfig(filename='example.log',level=logging.DEBUG) | |
# logging.debug('Only use when debugging') | |
# logging.info('General information') | |
# logging.warning('General warning') | |
# logging.error("Input errors") | |
# logging.critical("Environment or script errors") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment