def setup_logger():
    global logger

    log_levels = {
        'CRITICAL': logging.CRITICAL,
        'ERROR': logging.ERROR,
        'WARNING': logging.WARNING,
        'INFO': logging.INFO,
        'DEBUG': logging.DEBUG
    }

    settings.clear_on_change('log_level')

    logger.handlers = []

    formatter = logging.Formatter('[%(asctime)s] %(levelname)s %(message)s')
    log_path = os.path.join(sublime.installed_packages_path(), package_name + '.log')
    hdlr = logging.handlers.TimedRotatingFileHandler(log_path, interval=1, backupCount=4)
    hdlr.setFormatter(formatter)
    logger.addHandler(hdlr)

    log_level = settings.get('log_level', 'WARNING').upper()
    logger.setLevel(log_levels[log_level])
    logger.info(log_level % 'setting log level to %s')

    settings.add_on_change('log_level', setup_logger)
dataset/ETHPy150Open accerqueira/sublime-test-runner/TestRunner.py/setup_logger/swapped operands of `%`