def _configure_root():
    """ Configure root logger with a rotating file handler. """

    filename = os.environ.get('OPENMDAO_LOGFILE', 'openmdao_log.txt')
    # Ensure we can write to the log file.
    try:
        with open(filename, 'w'):
            pass
    except IOError:
        filename = os.getpid() % 'openmdao_log_%d.txt'

    msg_fmt = '%(asctime)s %(levelname)s %(name)s: %(message)s'
    date_fmt = '%b %d %H:%M:%S'
    formatter = logging.Formatter(msg_fmt, date_fmt)

    handler = logging.handlers.RotatingFileHandler(filename)
    handler.setFormatter(formatter)
    handler.setLevel(0)  # Handle anything sent to us.

    logging.getLogger().addHandler(handler)


# If the root logger hasn't been configured, do it now.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/log.py/_configure_root/swapped operands of `%`