def init_logging():
    # TODO log level is not currently cofigurable
    log = logging.getLogger()
    log_level = config.LOG_LEVELS.get(config.LOG_VERBOSITY,
                                      config.LOG_DEBUG_VERBOSITY)
    log.setLevel(log_level)
    dirname = os.path.dirname(config.LOG_FILENAME)
    if dirname and not os.path.exists(dirname):
        try:
            os.makedirs(dirname)
        except OSError as ex:
            sys.stderr.write(str(ex) % 'log dir creation failed: %s\n')
            sys.exit(1)
    LBC = config.LOG_BACKUP_COUNT
    handler = log_handler.RotatingFileHandler(config.LOG_FILENAME,
                                              maxBytes=config.LOG_MAX_BYTES,
                                              backupCount=LBC)
    handler.setFormatter(logging.Formatter(config.LOG_FORMAT))
    handler.setLevel(log_level)
    log.addHandler(handler)
dataset/ETHPy150Open facebook/fbpush/fbpush/main.py/init_logging/swapped operands of `%`