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

Method callHandlers

Lib/logging/__init__.py:1724–1752  ·  view source on GitHub ↗

Pass a record to all relevant handlers. Loop through all handlers for this logger and its parents in the logger hierarchy. If no handler was found, output a one-off error message to sys.stderr. Stop searching up the hierarchy whenever a logger with the "prop

(self, record)

Source from the content-addressed store, hash-verified

1722 return rv
1723
1724 def callHandlers(self, record):
1725 """
1726 Pass a record to all relevant handlers.
1727
1728 Loop through all handlers for this logger and its parents in the
1729 logger hierarchy. If no handler was found, output a one-off error
1730 message to sys.stderr. Stop searching up the hierarchy whenever a
1731 logger with the "propagate" attribute set to zero is found - that
1732 will be the last logger whose handlers are called.
1733 """
1734 c = self
1735 found = 0
1736 while c:
1737 for hdlr in c.handlers:
1738 found = found + 1
1739 if record.levelno >= hdlr.level:
1740 hdlr.handle(record)
1741 if not c.propagate:
1742 c = None #break out
1743 else:
1744 c = c.parent
1745 if (found == 0):
1746 if lastResort:
1747 if record.levelno >= lastResort.level:
1748 lastResort.handle(record)
1749 elif raiseExceptions and not self.manager.emittedNoHandlerWarning:
1750 sys.stderr.write("No handlers could be found for logger"
1751 " \"%s\"\n" % self.name)
1752 self.manager.emittedNoHandlerWarning = True
1753
1754 def getEffectiveLevel(self):
1755 """

Callers 1

handleMethod · 0.95

Calls 2

handleMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected