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)
| 1642 | return rv |
| 1643 | |
| 1644 | def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False, |
| 1645 | stacklevel=1): |
| 1646 | """ |
| 1647 | Low-level logging routine which creates a LogRecord and then calls |
| 1648 | all the handlers of this logger to handle the record. |
| 1649 | """ |
| 1650 | sinfo = None |
| 1651 | if _srcfile: |
| 1652 | #IronPython doesn't track Python frames, so findCaller raises an |
| 1653 | #exception on some versions of IronPython. We trap it here so that |
| 1654 | #IronPython can use logging. |
| 1655 | try: |
| 1656 | fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel) |
| 1657 | except ValueError: # pragma: no cover |
| 1658 | fn, lno, func = "(unknown file)", 0, "(unknown function)" |
| 1659 | else: # pragma: no cover |
| 1660 | fn, lno, func = "(unknown file)", 0, "(unknown function)" |
| 1661 | if exc_info: |
| 1662 | if isinstance(exc_info, BaseException): |
| 1663 | exc_info = (type(exc_info), exc_info, exc_info.__traceback__) |
| 1664 | elif not isinstance(exc_info, tuple): |
| 1665 | exc_info = sys.exc_info() |
| 1666 | record = self.makeRecord(self.name, level, fn, lno, msg, args, |
| 1667 | exc_info, func, extra, sinfo) |
| 1668 | self.handle(record) |
| 1669 | |
| 1670 | def handle(self, record): |
| 1671 | """ |