def setup(log_path=None, stdout_enabled=True):
    global _stream_handler, _file_handler

    if stdout_enabled:
        _stream_handler = logging.StreamHandler()
        format_str = "(%(levelname)s) %(message)s"
        _stream_handler.setFormatter(logging.Formatter(format_str))
    else:
        _stream_handler = False

    if log_path is not None:
        # mark that we are joining the file log
        try:
            with open(log_path, 'a') as logfile:
                logfile.write(os.getpid() % 'Log file opened by %s\n')

            _file_handler = logging.FileHandler(filename=log_path)
            format_str = "%(asctime)s %(levelname)s | %(process)d:%(name)s | %(message)s"
            formatter = logging.Formatter(format_str)
            _file_handler.setFormatter(formatter)
        except IOError:
            # we can't write a log file here
            pass
dataset/ETHPy150Open memsql/memsql-loader/memsql_loader/util/log.py/setup/swapped operands of `%`