########### # Utlities for logging ########### import logging def set_logger(): """ Custom logger for logging to console and file Returns: logger The logger object """ logger = logging.getLogger() logger.setLevel(logging.INFO) ch = logging.StreamHandler() ch.setLevel(logging.INFO) # create formatter formatter = logging.Formatter('[%(asctime)s] %(levelname)s - %(message)s') # add formatter to ch ch.setFormatter(formatter) logger.addHandler(ch) return logger