giants-stupid-server/utils/logger.py

17 lines
515 B
Python
Raw Permalink Normal View History

2019-01-22 01:30:42 +01:00
import logging
def setup_logger(name):
#_fh = logging.FileHandler("cerqual-deploy.log")
#_fh.setLevel("INFO")
_ch = logging.StreamHandler()
_ch.setLevel("DEBUG")
_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
_ch.setFormatter(_formatter)
#_fh.setFormatter(_formatter)
logger = logging.getLogger(name)
logger.addHandler(_ch)
#logger.addHandler(_fh)
logger.setLevel("DEBUG")
logger.debug("Logger initialized")
return logger