Commit 27dd403
committed
feat: use already calculated exc_text
The logging module sets the traceback string to `record.exc_text` and
doesn't caluclate it again.
This allows also to log exceptions, when we are not in the stack-context
anymore and have no `exc_info` tuple.
For example, in some cases, only the textual representation of a
traceback is stored because the traceback object would be a memory leak
and prevent garbage collection.
Use case is therefor:
`formatter.format(record)` where `exc_text` was already created by
another earlier formatter or filter.1 parent 4cb4158 commit 27dd403
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 109 | + | |
113 | 110 | | |
114 | 111 | | |
115 | 112 | | |
| |||
242 | 239 | | |
243 | 240 | | |
244 | 241 | | |
245 | | - | |
| 242 | + | |
246 | 243 | | |
247 | 244 | | |
248 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
| |||
0 commit comments