Last active
January 14, 2023 18:09
-
-
Save Kif11/d6d1aba377bc05fc7d60bf9549eab62d to your computer and use it in GitHub Desktop.
Python basic logging boilerplate for console log
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 | |
log = logging.getLogger() | |
handler = logging.StreamHandler() | |
handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s')) | |
log.addHandler(handler) | |
log.setLevel(logging.INFO) | |
log.info('Hello World!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment