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)
| 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 | """ |