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:
            handlers.append(logging.StreamHandler())

        loglevel = LOG_LEVELS.get(self.cfg.loglevel.lower(), logging.INFO)
        logger.setLevel(loglevel)

        format = r"%(asctime)s [%(process)d] [%(levelname)s] %(message)s"
        datefmt = r"%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/original