MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _log

Method _log

tools/python-3.11.9-amd64/Lib/logging/__init__.py:1610–1634  ·  view source on GitHub ↗

Low-level logging routine which creates a LogRecord and then calls all the handlers of this logger to handle the record.

(self, level, msg, args, exc_info=None, extra=None, stack_info=False,
             stacklevel=1)

Source from the content-addressed store, hash-verified

1608 return rv
1609
1610 def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False,
1611 stacklevel=1):
1612 """
1613 Low-level logging routine which creates a LogRecord and then calls
1614 all the handlers of this logger to handle the record.
1615 """
1616 sinfo = None
1617 if _srcfile:
1618 #IronPython doesn't track Python frames, so findCaller raises an
1619 #exception on some versions of IronPython. We trap it here so that
1620 #IronPython can use logging.
1621 try:
1622 fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
1623 except ValueError: # pragma: no cover
1624 fn, lno, func = "(unknown file)", 0, "(unknown function)"
1625 else: # pragma: no cover
1626 fn, lno, func = "(unknown file)", 0, "(unknown function)"
1627 if exc_info:
1628 if isinstance(exc_info, BaseException):
1629 exc_info = (type(exc_info), exc_info, exc_info.__traceback__)
1630 elif not isinstance(exc_info, tuple):
1631 exc_info = sys.exc_info()
1632 record = self.makeRecord(self.name, level, fn, lno, msg, args,
1633 exc_info, func, extra, sinfo)
1634 self.handle(record)
1635
1636 def handle(self, record):
1637 """

Callers 7

debugMethod · 0.95
infoMethod · 0.95
warningMethod · 0.95
errorMethod · 0.95
criticalMethod · 0.95
logMethod · 0.95
_logMethod · 0.45

Calls 4

findCallerMethod · 0.95
makeRecordMethod · 0.95
handleMethod · 0.95
typeClass · 0.50

Tested by

no test coverage detected