Defer logging formatting until the logger is actually called.

This would cause unnecessary format calls even if you didn't have
logging enabled.
This commit is contained in:
Rapptz
2017-06-09 18:53:24 -04:00
parent d239cc2666
commit b06899e7d4
6 changed files with 17 additions and 19 deletions

View File

@ -149,7 +149,7 @@ class OpusError(DiscordException):
def __init__(self, code):
self.code = code
msg = _lib.opus_strerror(self.code).decode('utf-8')
log.info('"{}" has happened'.format(msg))
log.info('"%s" has happened', msg)
super().__init__(msg)
class OpusNotLoaded(DiscordException):