From fd531297d29b59bfca25fb78a286db4c8149d06f Mon Sep 17 00:00:00 2001 From: espeonofespeonage Date: Sat, 23 Sep 2017 12:50:12 +0100 Subject: [PATCH] Changed discord.Client.event to debug log success instead of info log. This is suggested to prevent spamming the console unnecesarilly. Info should be used to output information to the user that is important, but not a warning or an error. If I am bundling a bot as a modular package then it doesn't really make sense to spam their console with every time a coroutine is subscribed to, as it likely will not mean anything to the user. If they are interested in this, it would make more sense to just to enable debugging first. I have made this change, as I am writing a wrapper for this library for a private project, and that will handle dispatching events, thus, I do not need a prompt for each event that is subscribed to in this module outside of DEBUG. Currently, with logging set to INFO, I am getting 47 lines reading: INFO:discord.client:coroutine has successfully been registered as an event ...being output as my bot starts, and without having to disable INFO logging altogether, I am currently having to temporarily change the verbosity of the logger as the events are initialised, which is not desirable as it could potentially cover up any other INFO messages that would be useful to have output. Using a filter seems like a bit of a hacky workaround. If this isn't acceptable then another alternative would be to add a parameter to the constructor of discord.Client to enable or disable printing this information. --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index 9000e27d8..17f3946d3 100644 --- a/discord/client.py +++ b/discord/client.py @@ -773,7 +773,7 @@ class Client: raise ClientException('event registered must be a coroutine function') setattr(self, coro.__name__, coro) - log.info('%s has successfully been registered as an event', coro.__name__) + log.debug('%s has successfully been registered as an event', coro.__name__) return coro def async_event(self, coro):