add logging to apps

This commit is contained in:
2023-03-21 19:18:08 -04:00
parent b68e48b1cf
commit c21cb03546
3 changed files with 43 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
import logging
import sys
def appLogger(name):
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
screen_handler = logging.StreamHandler(stream=sys.stdout)
screen_handler.setFormatter(formatter)
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
logger.addHandler(screen_handler)
return logger