mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Avoid extracting the stack twice in system_log (#112572)
This commit is contained in:
parent
1b824a4fea
commit
70a3f67e03
@ -180,8 +180,8 @@ class LogEntry:
|
|||||||
self.exception = "".join(traceback.format_exception(*record.exc_info))
|
self.exception = "".join(traceback.format_exception(*record.exc_info))
|
||||||
_, _, tb = record.exc_info
|
_, _, tb = record.exc_info
|
||||||
# Last line of traceback contains the root cause of the exception
|
# Last line of traceback contains the root cause of the exception
|
||||||
if traceback.extract_tb(tb):
|
if extracted := traceback.extract_tb(tb):
|
||||||
self.root_cause = str(traceback.extract_tb(tb)[-1])
|
self.root_cause = str(extracted[-1])
|
||||||
self.source = source
|
self.source = source
|
||||||
self.count = 1
|
self.count = 1
|
||||||
self.key = (self.name, source, self.root_cause)
|
self.key = (self.name, source, self.root_cause)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user