giantsd/utils/logger.py

17 lines
515 B
Python

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