Created
July 3, 2016 15:50
-
-
Save piotrbla/fc74e8e26711096300a4d12746b4520a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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