mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
separate car logger forwarded to cloudlog (#33170)
* car logger * try this * fix double printing! * clean up * need to import where we actually use it (card won't be in submodule) * NullHandler does not forward everything properly, need propagate=False to stop root logger from printing * card is staying * set up * forward old-commit-hash: 12a7b7f7fb1d3a275314b0232795942a7ff3b955
This commit is contained in:
@@ -104,6 +104,15 @@ class UnixDomainSocketHandler(logging.Handler):
|
||||
pass
|
||||
|
||||
|
||||
class ForwardingHandler(logging.Handler):
|
||||
def __init__(self, target_logger):
|
||||
super().__init__()
|
||||
self.target_logger = target_logger
|
||||
|
||||
def emit(self, record):
|
||||
self.target_logger.handle(record)
|
||||
|
||||
|
||||
def add_file_handler(log):
|
||||
"""
|
||||
Function to add the file log handler to swaglog.
|
||||
|
||||
Reference in New Issue
Block a user