def logger_has_handlers(logger):
    """
    Check if given logger has at least 1 handler associated, return a boolean value.

    Since Python 2 doesn't provide Logger.hasHandlers(), we have to perform the lookup by ourself.
    """
    if six.PY3:
        return logger.hasHandlers()
    else:
        c = logger
        rv = False
        while c:
            if c.handlers:
                rv = True
                break
            if not c.propagate:
                break
            else:
                c = c.parent
        return rv
Check if given logger has at least 1 handler associated, return a boolean value.

    Since Python 2 doesn't provide Logger.hasHandlers(), we have to perform the lookup by ourself.