Created
April 24, 2021 01:51
-
-
Save mtalimanchuk/0c8622822739633083c6b2972a066209 to your computer and use it in GitHub Desktop.
Minimal logging setup to configure a standalone logger
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 | |
logger = logging.getLogger("Logger name") | |
handler = logging.StreamHandler() | |
handler.setFormatter( | |
logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | |
) | |
logger.addHandler(handler) | |
logger.setLevel("INFO") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment