From 66c6f8130dbed16ada404f38c47f9881c05a3b80 Mon Sep 17 00:00:00 2001 From: George Tsiamasiotis Date: Sat, 28 Sep 2024 08:55:31 +0300 Subject: [PATCH] Replace logging.warn with logging.warning --- frigate/api/auth.py | 8 ++++---- frigate/config.py | 2 +- frigate/detectors/plugins/tensorrt.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frigate/api/auth.py b/frigate/api/auth.py index 37f8b5e7b..5276eb71e 100644 --- a/frigate/api/auth.py +++ b/frigate/api/auth.py @@ -54,7 +54,7 @@ def get_remote_addr(request: Request): try: network = ipaddress.ip_network(proxy) except ValueError: - logger.warn(f"Unable to parse trusted network: {proxy}") + logger.warning(f"Unable to parse trusted network: {proxy}") trusted_proxies.append(network) # return the first remote address that is not trusted @@ -122,7 +122,7 @@ def get_jwt_secret() -> str: with open(jwt_secret_file, "w") as f: f.write(str(jwt_secret)) except Exception: - logger.warn( + logger.warning( "Unable to write jwt token file to config directory. A new jwt token will be created at each startup." ) else: @@ -131,13 +131,13 @@ def get_jwt_secret() -> str: try: jwt_secret = f.readline() except Exception: - logger.warn( + logger.warning( "Unable to read jwt token from .jwt_secret file in config directory. A new jwt token will be created at each startup." ) jwt_secret = secrets.token_hex(64) if len(jwt_secret) < 64: - logger.warn("JWT Secret is recommended to be 64 characters or more") + logger.warning("JWT Secret is recommended to be 64 characters or more") return jwt_secret diff --git a/frigate/config.py b/frigate/config.py index 7705f4ee1..13de9873c 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -1619,7 +1619,7 @@ class FrigateConfig(FrigateBaseModel): self.ffmpeg, input.path ) except Exception: - logger.warn( + logger.warning( f"Error detecting stream parameters automatically for {input.path} Applying default values." ) stream_info = {"width": 0, "height": 0, "fourcc": None} diff --git a/frigate/detectors/plugins/tensorrt.py b/frigate/detectors/plugins/tensorrt.py index 901d18ee7..bb3c737ad 100644 --- a/frigate/detectors/plugins/tensorrt.py +++ b/frigate/detectors/plugins/tensorrt.py @@ -199,7 +199,7 @@ class TensorRtDetector(DetectionApi): # Run inference. if not self._execute(): - logger.warn("Execute returned false") + logger.warning("Execute returned false") # Transfer predictions back from the GPU. [