diff --git a/bot.py b/bot.py index bbcb1e5..dd28937 100755 --- a/bot.py +++ b/bot.py @@ -62,6 +62,9 @@ console_handler = logging.StreamHandler() console_handler.setLevel(logging.INFO) console_handler.setFormatter(formatter) logger.addHandler(console_handler) +# Some dependency calls logging.basicConfig(), adding a root handler; without +# this the 'discord' logger's records get printed twice (our format + root's). +logger.propagate = False # *=========================================== Initializations intents = discord.Intents.default() @@ -238,7 +241,10 @@ async def _run_bot(token: str, shutdown_event: asyncio.Event) -> None: docker). Now every death is diagnosed on the console first. """ try: - await client.start(token, log_handler=None) + # NOTE: log_handler is a Client.run()-only kwarg (run() configures + # logging, then calls start()); start() takes just the token. We set + # up our own handlers above, so nothing is lost. + await client.start(token) except discord.LoginFailure: logger.critical( "FATAL: Discord REJECTED the token (Improper token). Fix the "