Add workaround for python bug to HAQueueHandler (#66541)
This commit is contained in:
parent
cb03db8df4
commit
2538af4b06
1 changed files with 9 additions and 0 deletions
|
@ -33,6 +33,15 @@ class HideSensitiveDataFilter(logging.Filter):
|
|||
class HomeAssistantQueueHandler(logging.handlers.QueueHandler):
|
||||
"""Process the log in another thread."""
|
||||
|
||||
def prepare(self, record: logging.LogRecord) -> logging.LogRecord:
|
||||
"""Prepare a record for queuing.
|
||||
|
||||
This is added as a workaround for https://bugs.python.org/issue46755
|
||||
"""
|
||||
record = super().prepare(record)
|
||||
record.stack_info = None
|
||||
return record
|
||||
|
||||
def handle(self, record: logging.LogRecord) -> Any:
|
||||
"""
|
||||
Conditionally emit the specified logging record.
|
||||
|
|
Loading…
Add table
Reference in a new issue