Skip to content

Instantly share code, notes, and snippets.

@datitran
Created November 7, 2016 15:40
Show Gist options
  • Save datitran/4bd2e75016dd81acb455bd2f891f527e to your computer and use it in GitHub Desktop.
Save datitran/4bd2e75016dd81acb455bd2f891f527e to your computer and use it in GitHub Desktop.
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment