mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
[lint] Do log formating lazily
Convert log("fmt" % args) to log("fmt", args) as the latter is lazy and does not do the formating if the string is never logged.
This commit is contained in:
@ -44,14 +44,14 @@ EncoderStructPtr = ctypes.POINTER(EncoderStruct)
|
||||
|
||||
def _err_lt(result, func, args):
|
||||
if result < 0:
|
||||
log.info('error has happened in {0.__name__}'.format(func))
|
||||
log.info('error has happened in %s', func.__name__)
|
||||
raise OpusError(result)
|
||||
return result
|
||||
|
||||
def _err_ne(result, func, args):
|
||||
ret = args[-1]._obj
|
||||
if ret.value != 0:
|
||||
log.info('error has happened in {0.__name__}'.format(func))
|
||||
log.info('error has happened in %s', func.__name__)
|
||||
raise OpusError(ret.value)
|
||||
return result
|
||||
|
||||
|
Reference in New Issue
Block a user