giantsd/utils/logger.py
2019-01-22 01:30:42 +01:00

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