Created
March 5, 2022 09:42
-
-
Save roshane/0aa888582a675608e0119378a324f2e1 to your computer and use it in GitHub Desktop.
python std out 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 | |
import sys | |
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format=log_format) | |
def get_logger(name): | |
return logging.getLogger(name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment