From 6b051ded0dc7262beca3aa511e5d914d99445a02 Mon Sep 17 00:00:00 2001 From: Devoxin Date: Sat, 24 Mar 2018 13:08:33 +0000 Subject: [PATCH] Fix some more issues regarding logging --- lavalink/Client.py | 2 +- lavalink/WebSocket.py | 12 ++++++------ lavalink/__init__.py | 2 +- setup.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lavalink/Client.py b/lavalink/Client.py index dd05f363..b5661af5 100644 --- a/lavalink/Client.py +++ b/lavalink/Client.py @@ -63,7 +63,7 @@ async def update_state(self, data): p.position_timestamp = data['state']['time'] async def get_tracks(self, query): - log.debug('Requesting tracks for query ', query) + log.debug('Requesting tracks for query %s', query) async with self.http.get(self.rest_uri + query, headers={'Authorization': self.password}) as res: js = await res.json(content_type=None) res.close() diff --git a/lavalink/WebSocket.py b/lavalink/WebSocket.py index 66537512..015297d4 100644 --- a/lavalink/WebSocket.py +++ b/lavalink/WebSocket.py @@ -51,7 +51,7 @@ async def connect(self): try: self._ws = await websockets.connect(self._uri, loop=self._loop, extra_headers=headers) except OSError as error: - log.exception('Failed to connect to Lavalink\n\t', str(error)) + log.exception('Failed to connect to Lavalink %s', str(error)) else: log.info('Connected to Lavalink!') self._loop.create_task(self.listen()) @@ -84,7 +84,7 @@ async def listen(self): try: data = json.loads(await self._ws.recv()) except websockets.ConnectionClosed as error: - log.warning('Disconnected from Lavalink\n\t', str(error)) + log.warning('Disconnected from Lavalink %s', str(error)) self._lavalink.players.clear() if self._shutdown is True: @@ -97,10 +97,10 @@ async def listen(self): break op = data.get('op', None) - log.debug('Received websocket data\n\t', str(data)) + log.debug('Received websocket data %s', str(data)) if not op: - return log.debug('Received websocket message without op\n\t', str(data)) + return log.debug('Received websocket message without op %s', str(data)) if op == 'event': log.debug('Received event of type %s', data['type']) @@ -125,11 +125,11 @@ async def listen(self): async def send(self, **data): """ Sends data to lavalink """ if self._ws is not None and self._ws.open: - log.debug('Sending payload:\n\t', str(data)) + log.debug('Sending payload %s', str(data)) await self._ws.send(json.dumps(data)) else: self._queue.append(data) - log.debug('Send called before websocket ready; queueing payload\n\t', str(data)) + log.debug('Send called before websocket ready; queueing payload %s', str(data)) def destroy(self): self._shutdown = False diff --git a/lavalink/__init__.py b/lavalink/__init__.py index 80277ae4..5c9cf32d 100644 --- a/lavalink/__init__.py +++ b/lavalink/__init__.py @@ -2,7 +2,7 @@ __author__ = 'Luke & William' __license__ = 'MIT' __copyright__ = 'Copyright 2018 Luke & William' -__version__ = '2.1.2' +__version__ = '2.1.3' from .AudioTrack import * from .Client import * diff --git a/setup.py b/setup.py index 73cf9e8d..a8b7dc1b 100644 --- a/setup.py +++ b/setup.py @@ -4,12 +4,12 @@ setup( name='lavalink', packages=['lavalink'], - version='2.1.2', + version='2.1.3', description='A lavalink interface built for discord.py', author='Luke, William', author_email='dev@crimsonxv.pro', url='https://github.com/Devoxin/Lavalink.py', - download_url='https://github.com/Devoxin/Lavalink.py/archive/2.1.2.tar.gz', + download_url='https://github.com/Devoxin/Lavalink.py/archive/2.1.3.tar.gz', keywords=['lavalink'], include_package_data=True, install_requires=['websockets>=4.0.0', 'aiohttp']