Skip to content

Instantly share code, notes, and snippets.

@idaWHALE
Last active December 5, 2018 01:37
Show Gist options
  • Save idaWHALE/2828db4909d67bc7c43e949b238587bd to your computer and use it in GitHub Desktop.
Save idaWHALE/2828db4909d67bc7c43e949b238587bd to your computer and use it in GitHub Desktop.
import logging
logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] %(processName)s:%(threadName)-12s %(name)s:%(lineno)-7d (%(asctime)s) %(message)s', )
logger = logging.getLogger('MdnMonReport')
def test():
try:
print('holder')
raise Exception('We got an exception')
except Exception as e:
logger.exception('Exception in test')
logger.info('info')
logger.error('error')
logger.debug('Done testing exception logging')
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment