aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorHornwitser <[email protected]>2015-10-20 18:11:52 +0200
committerHornwitser <[email protected]>2015-10-21 01:03:25 +0200
commit9ab1d041d46210644b1258c23f67b1ed60546832 (patch)
tree8120256052338eb759b686218847aacd5587063e /discord/client.py
parentFix Client.create_invite invalid method call issue. (diff)
downloaddiscord.py-9ab1d041d46210644b1258c23f67b1ed60546832.tar.xz
discord.py-9ab1d041d46210644b1258c23f67b1ed60546832.zip
Log to root logger by default in on_error
Change the default implementation of on_error to log to the root logger instead of discord.client and clarify that the exception is being ignored. This ensures that a message will be output to standard error in case the logging module has not been configured. Also removes the argument printing for the default on_error, this is due to them often being too long, that they could cause another exception to be thrown, and because it sometimes causes sensitive information to be output such as Discord tokens and session ids. It was also possible for the length to get in the megabyte range with exceptions thrown by on_socket_raw_receive in READY events.
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index 7817c0c1..644a96ab 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -478,8 +478,7 @@ class Client(object):
raise InvalidDestination('Destination must be Channel, PrivateChannel, User, or str')
def on_error(self, event_method, *args, **kwargs):
- msg = 'Caught exception in {} with args (*{}, **{})'
- log.exception(msg.format(event_method, args, kwargs))
+ logging.exception('Ignoring exception in {}'.format(event_method))
# Compatibility shim
def __getattr__(self, name):