Skip to content

Instantly share code, notes, and snippets.

@piotrbla
Created July 3, 2016 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotrbla/fc74e8e26711096300a4d12746b4520a to your computer and use it in GitHub Desktop.
Save piotrbla/fc74e8e26711096300a4d12746b4520a to your computer and use it in GitHub Desktop.
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-7s %(message)s',
datefmt='[%d-%m-%Y %H:%M:%S]',
filename='sorting.txt',
filemode='w'
)
logging.info("Coś tam")
formatter = logging.Formatter('%(levelname)-7s %(message)s')
creepy_log = logging.StreamHandler()
creepy_log.setFormatter(formatter)
logging.getLogger('').addHandler(creepy_log)
logging.info("Coś tam jeszcze innego")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment