Skip to content

Instantly share code, notes, and snippets.

@gianrubio
Created April 26, 2017 09:35
Show Gist options
  • Save gianrubio/4c7d31c972862b70f737b67c11de3a1d to your computer and use it in GitHub Desktop.
Save gianrubio/4c7d31c972862b70f737b67c11de3a1d to your computer and use it in GitHub Desktop.
python console logger
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