forked from blizzthewolf/SeaCogs
fix(pterodactyl): use a custom logger for the websocket instead of websockets.client
This commit is contained in:
parent
837bf4aa34
commit
8b1e42716b
1 changed files with 3 additions and 1 deletions
|
@ -1,8 +1,10 @@
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
from logging import getLogger
|
||||||
from typing import Optional, Union
|
from typing import Optional, Union
|
||||||
|
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import discord
|
import discord
|
||||||
import websockets
|
import websockets
|
||||||
|
@ -21,7 +23,7 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None:
|
||||||
|
|
||||||
websocket_credentials = await retrieve_websocket_credentials(coginstance)
|
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")
|
logger.info("WebSocket connection established")
|
||||||
|
|
||||||
auth_message = json.dumps({"event": "auth", "args": [websocket_credentials['data']['token']]})
|
auth_message = json.dumps({"event": "auth", "args": [websocket_credentials['data']['token']]})
|
||||||
|
|
Loading…
Reference in a new issue