def log_on_errors(env):
    """Return a function receiving errors and logging them.

    The resulting function is suitable to be used as the on_errors callback
    for WaitForUnits (see above).
    """
    return env.log_errors
