#!/usr/bin/env python | |
""" Logger initialization """ | |
import logging | |
def define_logger(name): | |
""" Initialization of logger""" | |
logger = logging.getLogger(name) | |
logger.setLevel(logging.INFO) | |
ch = logging.StreamHandler() | |
ch.setLevel(logging.INFO) | |
logger.addHandler(ch) | |
log_format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s' | |
formatter = logging.Formatter(log_format, | |
"%H:%M:%S") | |
ch.setFormatter(formatter) | |
return logger |