chore(backend): .warn -> .warning

This commit is contained in:
AAGaming
2024-09-01 14:17:11 -04:00
parent 016ed6e998
commit 6ae6f5ee67
6 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ def get_loader_version() -> str:
return version_str return version_str
except Exception as e: except Exception as e:
logger.warn(f"Failed to execute get_loader_version(): {str(e)}") logger.warning(f"Failed to execute get_loader_version(): {str(e)}")
return "unknown" return "unknown"
user_agent = f"Decky/{get_loader_version()} (https://decky.xyz)" user_agent = f"Decky/{get_loader_version()} (https://decky.xyz)"
@@ -102,7 +102,7 @@ def get_system_pythonpaths() -> list[str]:
versions = [x.strip() for x in proc.stdout.decode().strip().split("\n")] versions = [x.strip() for x in proc.stdout.decode().strip().split("\n")]
return [x for x in versions if x and not x.isspace()] return [x for x in versions if x and not x.isspace()]
except Exception as e: except Exception as e:
logger.warn(f"Failed to execute get_system_pythonpaths(): {str(e)}") logger.warning(f"Failed to execute get_system_pythonpaths(): {str(e)}")
return [] return []
# Download Remote Binaries to local Plugin # Download Remote Binaries to local Plugin
+3 -3
View File
@@ -46,7 +46,7 @@ class Tab:
async for message in self.websocket: async for message in self.websocket:
data = message.json() data = message.json()
yield data yield data
logger.warn(f"The Tab {self.title} socket has been disconnected while listening for messages.") logger.warning(f"The Tab {self.title} socket has been disconnected while listening for messages.")
await self.close_websocket() await self.close_websocket()
async def _send_devtools_cmd(self, dc: Dict[str, Any], receive: bool = True): async def _send_devtools_cmd(self, dc: Dict[str, Any], receive: bool = True):
@@ -381,10 +381,10 @@ async def get_tabs() -> List[Tab]:
na = True na = True
await sleep(5) await sleep(5)
except ClientOSError: except ClientOSError:
logger.warn(f"The request to {BASE_ADDRESS}/json was reset") logger.warning(f"The request to {BASE_ADDRESS}/json was reset")
await sleep(1) await sleep(1)
except TimeoutError: except TimeoutError:
logger.warn(f"The request to {BASE_ADDRESS}/json timed out") logger.warning(f"The request to {BASE_ADDRESS}/json timed out")
await sleep(1) await sleep(1)
else: else:
break break
@@ -203,7 +203,7 @@ def get_unprivileged_path() -> str:
path = None path = None
if path == None: if path == None:
logger.warn("Unprivileged path is not properly configured. Defaulting to /home/deck/homebrew") logger.warning("Unprivileged path is not properly configured. Defaulting to /home/deck/homebrew")
path = "/home/deck/homebrew" # We give up path = "/home/deck/homebrew" # We give up
os.makedirs(path, exist_ok=True) os.makedirs(path, exist_ok=True)
@@ -225,7 +225,7 @@ def get_unprivileged_user() -> str:
break break
if user == None: if user == None:
logger.warn("Unprivileged user is not properly configured. Defaulting to 'deck'") logger.warning("Unprivileged user is not properly configured. Defaulting to 'deck'")
user = 'deck' user = 'deck'
return user return user
@@ -238,7 +238,7 @@ close_cef_socket_lock = Lock()
async def close_cef_socket(): async def close_cef_socket():
async with close_cef_socket_lock: async with close_cef_socket_lock:
if _get_effective_user_id() != 0: if _get_effective_user_id() != 0:
logger.warn("Can't close CEF socket as Decky isn't running as root.") logger.warning("Can't close CEF socket as Decky isn't running as root.")
return return
# Look for anything listening TCP on port 8080 # Look for anything listening TCP on port 8080
lsof = run(["lsof", "-F", "-iTCP:8080", "-sTCP:LISTEN"], capture_output=True, text=True) lsof = run(["lsof", "-F", "-iTCP:8080", "-sTCP:LISTEN"], capture_output=True, text=True)
+2 -2
View File
@@ -106,7 +106,7 @@ class PluginManager:
new_time = time() new_time = time()
if (new_time - self.last_webhelper_exit < 60): if (new_time - self.last_webhelper_exit < 60):
self.webhelper_crash_count += 1 self.webhelper_crash_count += 1
logger.warn(f"webhelper crashed within a minute from last crash! crash count: {self.webhelper_crash_count}") logger.warning(f"webhelper crashed within a minute from last crash! crash count: {self.webhelper_crash_count}")
else: else:
self.webhelper_crash_count = 0 self.webhelper_crash_count = 0
self.last_webhelper_exit = new_time self.last_webhelper_exit = new_time
@@ -147,7 +147,7 @@ class PluginManager:
pass pass
logger.debug(f"Task {task} finished") logger.debug(f"Task {task} finished")
except: except:
logger.warn(f"Failed to cancel task {task}:\n" + format_exc()) logger.warning(f"Failed to cancel task {task}:\n" + format_exc())
pass pass
if current: if current:
tasks.remove(current) tasks.remove(current)
+3 -3
View File
@@ -85,7 +85,7 @@ class PluginWrapper:
async def execute_legacy_method(self, method_name: str, kwargs: Dict[Any, Any]): async def execute_legacy_method(self, method_name: str, kwargs: Dict[Any, Any]):
if not self.legacy_method_warning: if not self.legacy_method_warning:
self.legacy_method_warning = True self.legacy_method_warning = True
self.log.warn(f"Plugin {self.name} is using legacy method calls. This will be removed in a future release.") self.log.warning(f"Plugin {self.name} is using legacy method calls. This will be removed in a future release.")
if self.passive: if self.passive:
raise RuntimeError("This plugin is passive (aka does not implement main.py)") raise RuntimeError("This plugin is passive (aka does not implement main.py)")
@@ -144,10 +144,10 @@ class PluginWrapper:
elapsed_time = time() - start_time elapsed_time = time() - start_time
if elapsed_time >= 5 and not sigtermed: if elapsed_time >= 5 and not sigtermed:
sigtermed = True sigtermed = True
self.log.warn(f"Plugin {self.name} still alive 5 seconds after stop request! Sending SIGTERM!") self.log.warning(f"Plugin {self.name} still alive 5 seconds after stop request! Sending SIGTERM!")
self.terminate() self.terminate()
elif elapsed_time >= 10: elif elapsed_time >= 10:
self.log.warn(f"Plugin {self.name} still alive 10 seconds after stop request! Sending SIGKILL!") self.log.warning(f"Plugin {self.name} still alive 10 seconds after stop request! Sending SIGKILL!")
self.terminate(True) self.terminate(True)
await sleep(0.1) await sleep(0.1)
+3 -3
View File
@@ -50,7 +50,7 @@ class WSRouter:
if self.ws != None: if self.ws != None:
await self.ws.send_json(data) await self.ws.send_json(data)
else: else:
self.logger.warn("Dropping message as there is no connected socket: %s", data) self.logger.warning("Dropping message as there is no connected socket: %s", data)
def add_route(self, name: str, route: Route): def add_route(self, name: str, route: Route):
self.routes[name] = route self.routes[name] = route
@@ -69,9 +69,9 @@ class WSRouter:
if instance_id != self.instance_id: if instance_id != self.instance_id:
try: try:
self.logger.warn("Ignoring %s reply from stale instance %d with args %s and response %s", route, instance_id, args, res) self.logger.warning("Ignoring %s reply from stale instance %d with args %s and response %s", route, instance_id, args, res)
except: except:
self.logger.warn("Ignoring %s reply from stale instance %d (failed to log event data)", route, instance_id) self.logger.warning("Ignoring %s reply from stale instance %d (failed to log event data)", route, instance_id)
finally: finally:
return return