mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-01 02:57:41 +03:00
Save stderr too
This commit is contained in:
parent
782c08e9f2
commit
82a5c720d6
@ -145,12 +145,15 @@ def redirect_stdout_to_logpipe(log_name: str, level: int):
|
|||||||
current_log_pipe = LogPipe()
|
current_log_pipe = LogPipe()
|
||||||
|
|
||||||
old_stdout = sys.stdout
|
old_stdout = sys.stdout
|
||||||
|
old_stderr = sys.stderr
|
||||||
sys.stdout = current_log_pipe
|
sys.stdout = current_log_pipe
|
||||||
|
sys.stderr = current_log_pipe
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = func(*args, **kwargs)
|
result = func(*args, **kwargs)
|
||||||
finally:
|
finally:
|
||||||
sys.stdout = old_stdout
|
sys.stdout = old_stdout
|
||||||
|
sys.stderr = old_stderr
|
||||||
current_log_pipe.dump()
|
current_log_pipe.dump()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user