

def set_logging(self):
    logger = logging.getLogger()
    handlers = []
    if ((self.cfg.logfile is not None) and (self.cfg.logfile != '-')):
        handlers.append(logging.FileHandler(self.cfg.logfile))
    else:
        loglevel.append(logging.StreamHandler())
    loglevel = LOG_LEVELS.get(self.cfg.loglevel.lower(), logging.INFO)
    logger.setLevel(loglevel)
    format = '%(asctime)s [%(process)d] [%(levelname)s] %(message)s'
    datefmt = '%Y-%m-%d %H:%M:%S'
    for h in handlers:
        h.setFormatter(logging.Formatter(format, datefmt))
        logger.addHandler(h)

dataset/ETHPy150Open benoitc/gaffer/gaffer/gafferd/main.py Server.set_logging/VarMisuse@70/76 `handlers`->`loglevel`