def shouldLogEvent(predicates, event):
    """
    Determine whether an event should be logged, based on the result of
    C{predicates}.

    By default, the result is C{True}; so if there are no predicates,
    everything will be logged.

    If any predicate returns C{yes}, then we will immediately return C{True}.

    If any predicate returns C{no}, then we will immediately return C{False}.

    As predicates return C{maybe}, we keep calling the next predicate until we
    run out, at which point we return C{True}.

    @param predicates: The predicates to use.
    @type predicates: iterable of L{ILogFilterPredicate}

    @param event: An event
    @type event: L{dict}

    @return: True if the message should be forwarded on, C{False} if not.
    @rtype: L{bool}
    """
    for predicate in predicates:
        result = predicate(event)
        if result == PredicateResult.yes:
            return True
        if result == PredicateResult.no:
            return False
        if result == PredicateResult.maybe:
            continue
        raise TypeError("Invalid predicate result: {0!r}".format(result))
    return True

    Determine whether an event should be logged, based on the result of
    C{predicates}.

    By default, the result is C{True}; so if there are no predicates,
    everything will be logged.

    If any predicate returns C{yes}, then we will immediately return C{True}.

    If any predicate returns C{no}, then we will immediately return C{False}.

    As predicates return C{maybe}, we keep calling the next predicate until we
    run out, at which point we return C{True}.

    @param predicates: The predicates to use.
    @type predicates: iterable of L{ILogFilterPredicate}

    @param event: An event
    @type event: L{dict}

    @return: True if the message should be forwarded on, C{False} if not.
    @rtype: L{bool}
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/_filter.py