MCPcopy Index your code
hub / github.com/python/cpython / hasHandlers

Method hasHandlers

Lib/logging/__init__.py:1702–1722  ·  view source on GitHub ↗

See if this logger has any handlers configured. Loop through all handlers for this logger and its parents in the logger hierarchy. Return True if a handler was found, else False. Stop searching up the hierarchy whenever a logger with the "propagate" attribut

(self)

Source from the content-addressed store, hash-verified

1700 self.handlers.remove(hdlr)
1701
1702 def hasHandlers(self):
1703 """
1704 See if this logger has any handlers configured.
1705
1706 Loop through all handlers for this logger and its parents in the
1707 logger hierarchy. Return True if a handler was found, else False.
1708 Stop searching up the hierarchy whenever a logger with the "propagate"
1709 attribute set to zero is found - that will be the last logger which
1710 is checked for the existence of handlers.
1711 """
1712 c = self
1713 rv = False
1714 while c:
1715 if c.handlers:
1716 rv = True
1717 break
1718 if not c.propagate:
1719 break
1720 else:
1721 c = c.parent
1722 return rv
1723
1724 def callHandlers(self, record):
1725 """

Callers 5

hasHandlersMethod · 0.45
setUpMethod · 0.45
test_has_handlersMethod · 0.45
test_has_handlersMethod · 0.45

Calls

no outgoing calls

Tested by 4

setUpMethod · 0.36
test_has_handlersMethod · 0.36
test_has_handlersMethod · 0.36