From 8b1e42716b854233d6ad5f3880e82bad401bea97 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 1 Mar 2024 14:04:10 -0500 Subject: [PATCH] fix(pterodactyl): use a custom logger for the websocket instead of websockets.client --- pterodactyl/websocket.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pterodactyl/websocket.py b/pterodactyl/websocket.py index b87c7b7..c814ada 100644 --- a/pterodactyl/websocket.py +++ b/pterodactyl/websocket.py @@ -1,8 +1,10 @@ # pylint: disable=cyclic-import import json import re +from logging import getLogger from typing import Optional, Union + import aiohttp import discord import websockets @@ -21,7 +23,7 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None: websocket_credentials = await retrieve_websocket_credentials(coginstance) - async with websockets.connect(websocket_credentials['data']['socket'], origin=base_url, ping_timeout=60) as websocket: + async with websockets.connect(websocket_credentials['data']['socket'], origin=base_url, ping_timeout=60, logger=getLogger("red.sea.pterodactyl.websocket")) as websocket: logger.info("WebSocket connection established") auth_message = json.dumps({"event": "auth", "args": [websocket_credentials['data']['token']]})