[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:
Hornwitser
2018-07-31 18:19:43 +02:00
committed by Rapptz
parent a0634b3eea
commit 34fd266cf9
2 changed files with 4 additions and 4 deletions

View File

@ -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