def hasHandlers(logger):
 rv = False
 while logger:
  if logger.handlers:
   rv = True
   break
  elif (not logger.propagate):
   break
  else:
   logger = logger.parent
 return rv

def hasHandlers ( logger ) : rv = False while logger : if logger . handlers : rv = True break elif ( not logger . propagate ) : break else : logger = logger . parent return rv
see if a logger has any handlers .