Skip to content

Instantly share code, notes, and snippets.

@alanduan
Created December 15, 2016 03:52
Show Gist options
  • Save alanduan/84af2e025189a03fbc3bbde5a2d77932 to your computer and use it in GitHub Desktop.
Save alanduan/84af2e025189a03fbc3bbde5a2d77932 to your computer and use it in GitHub Desktop.
import logging
logger = logging.getLogger(__file__)
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
logger.info('this is a test message')
logger.warn('this is a warning message')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment