Last active
March 22, 2023 14:53
-
-
Save aasthavar/033e4f7baee95ff3138ca23da20daf5a to your computer and use it in GitHub Desktop.
Python Logger setup
This file contains hidden or 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 | |
| import sys | |
| # Set up logging | |
| logger = logging.getLogger(__name__) | |
| logging.basicConfig( | |
| level=logging.getLevelName("INFO"), | |
| handlers=[logging.StreamHandler(sys.stdout)], | |
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | |
| ) | |
| logger.info('Happy Logging :) !!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment