def getLogger(self):
''' Initialize and load log handlers '''
logger = logging.getLogger(self.proc_name)
logger.setLevel(logging.INFO)
if "debug" in self.config['logging']:
if self.config['logging']['debug']:
logger.setLevel(logging.DEBUG)
# Load and add a handler for each logging mechanism
for loghandler in self.config['logging']['plugins'].keys():
plugin = __import__("plugins.logging." + loghandler, globals(),
locals(), ['Logger'], -1)
lh = plugin.Logger(config=self.config, proc_name=self.proc_name)
logger.addHandler(lh.setup())
return logger
评论列表
文章目录