mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-29 15:19:00 +03:00
0.17 tweaks (#18892)
* Set version * Cleanup more logs * Don't log matplotlib
This commit is contained in:
committed by
Blake Blackshear
parent
cf62bee170
commit
ceeb6543f5
+3
-2
@@ -80,6 +80,7 @@ def apply_log_levels(default: str, log_levels: dict[str, LogLevel]) -> None:
|
||||
log_levels = {
|
||||
"absl": LogLevel.error,
|
||||
"httpx": LogLevel.error,
|
||||
"matplotlib": LogLevel.error,
|
||||
"tensorflow": LogLevel.error,
|
||||
"werkzeug": LogLevel.error,
|
||||
"ws4py": LogLevel.error,
|
||||
@@ -193,7 +194,7 @@ class LogRedirect(io.StringIO):
|
||||
|
||||
|
||||
@contextmanager
|
||||
def redirect_fd_to_queue(queue: Queue[str]) -> Generator[None, None, None]:
|
||||
def __redirect_fd_to_queue(queue: Queue[str]) -> Generator[None, None, None]:
|
||||
"""Redirect file descriptor 1 (stdout) to a pipe and capture output in a queue."""
|
||||
stdout_fd = os.dup(1)
|
||||
read_fd, write_fd = os.pipe()
|
||||
@@ -249,7 +250,7 @@ def redirect_output_to_logger(logger: logging.Logger, level: int) -> Any:
|
||||
|
||||
try:
|
||||
# Redirect C-level stdout
|
||||
with redirect_fd_to_queue(queue):
|
||||
with __redirect_fd_to_queue(queue):
|
||||
result = func(*args, **kwargs)
|
||||
finally:
|
||||
# Restore Python stdout/stderr
|
||||
|
||||
Reference in New Issue
Block a user