Skip to content

Instantly share code, notes, and snippets.

View Rotzke's full-sized avatar
🇩🇪

Nils Bergmüller Rotzke

🇩🇪
  • Berlin, Germany
  • 09:26 (UTC +02:00)
View GitHub Profile
@Rotzke
Rotzke / logging.py
Last active September 26, 2021 20:40
Logging module config
# stdout
logging.basicConfig(format='[%(asctime)s] %(levelname)s: %(message)s',
level=logging.INFO, datefmt='%Y/%m/%dT%H:%M:%S')
# file
logging.basicConfig(filename="log",
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
datefmt='%H:%M:%S',
level=logging.DEBUG)