MCPcopy Index your code
hub / github.com/RustPython/RustPython / callHandlers

Method callHandlers

Lib/logging/__init__.py:1728–1756  ·  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

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

Callers 1

handleMethod · 0.95

Calls 2

handleMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected