Skip to content

Instantly share code, notes, and snippets.

@pzelasko
Last active March 30, 2020 21:38
Show Gist options
  • Save pzelasko/855ced8a5a20fc0e18443db8a68022cb to your computer and use it in GitHub Desktop.
Save pzelasko/855ced8a5a20fc0e18443db8a68022cb to your computer and use it in GitHub Desktop.
Enable fancy logging
import logging
from sys import stdout
def fancy_logging(level=logging.DEBUG, stream=stdout):
logging.basicConfig(
level=level,
format="[%(asctime)s] %(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s",
datefmt="%H:%M:%S",
stream=stream
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment