Logs the stack trace of the most recently caught exception. This method captures the type, value, and traceback of the most recent exception and logs it using the trace level. It is typically used for debugging purposes. Anything logged using this method will always be written to t
(self, msg=None)
| 1709 | self.trace() |
| 1710 | |
| 1711 | def trace(self, msg=None): |
| 1712 | """Logs the stack trace of the most recently caught exception. |
| 1713 | |
| 1714 | This method captures the type, value, and traceback of the most recent exception and logs it using the trace level. It is typically used for debugging purposes. |
| 1715 | |
| 1716 | Anything logged using this method will always be written to the scan's `debug.log`, even if debugging is not enabled. |
| 1717 | |
| 1718 | Examples: |
| 1719 | >>> try: |
| 1720 | >>> 1 / 0 |
| 1721 | >>> except ZeroDivisionError: |
| 1722 | >>> self.trace() |
| 1723 | """ |
| 1724 | if msg is None: |
| 1725 | e_type, e_val, e_traceback = exc_info() |
| 1726 | if e_type is not None: |
| 1727 | self.log.trace(traceback.format_exc()) |
| 1728 | else: |
| 1729 | self.log.trace(msg) |
| 1730 | |
| 1731 | def critical(self, *args, trace=True, **kwargs): |
| 1732 | """Logs a whole message in emboldened red text, and optionally the stack trace of the most recent exception. |
no outgoing calls
no test coverage detected