Skip to content

Commit

Permalink
Fix some more issues regarding logging
Browse files Browse the repository at this point in the history
devoxin committed Mar 24, 2018
1 parent f65447c commit 6b051de
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lavalink/Client.py
Original file line number Diff line number Diff line change
@@ -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()
12 changes: 6 additions & 6 deletions lavalink/WebSocket.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lavalink/__init__.py
Original file line number Diff line number Diff line change
@@ -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 *
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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']

0 comments on commit 6b051de

Please sign in to comment.