import logging


def logger_has_filter(logger, filter_class):
    """
    Will `logger` execute a filter of `filter_class`?

    :param logging.Logger logger: the logger to examine
    :param class filter_class: the filter class to search for
    :return: :data:`True` if the `logger` contains a `filter_class`
        filter instance in it's chain
    :rtype: bool

    """
    if isinstance(logger, logging.Logger):
        for filter in logger.filters:
            if isinstance(filter, filter_class):
                return True
        for handler in logger.handlers:
            for filter in handler.filters:
                if isinstance(filter, filter_class):
                    return True
        if logger.propagate and logger.parent:
            if logger_has_filter(logger.parent, filter_class):
                return True
    return False