code: def logger_has_handlers(logger):
      
      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
docs: 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.