While trying to reload the reddit cog, I noticed that the cogs cog doesn't log the full traceback in the except blocks, but just the exception message using log.error. It would be better to use log.exception here to make sure that the full traceback is included instead of just a message like 'NoneType' object has no attribute 'startswith'. (log.exception automatically includes the full traceback when used in an exception handler, no additional arguments required.)
I suspect that more cogs do this, so I think it's a good idea to check all the cogs after the Django migration is completed to change the log methods to log.exception inside exception handlers where appropriate.
Example from the cogs cog (it's both in master and django):
|
log.error(f"{ctx.author} requested we load the '{cog}' cog, " |
|
log.error(f"{ctx.author} requested we load the '{cog}' cog, " |
While trying to reload the
redditcog, I noticed that thecogscog doesn't log the full traceback in theexceptblocks, but just the exception message usinglog.error. It would be better to uselog.exceptionhere to make sure that the full traceback is included instead of just a message like'NoneType' object has no attribute 'startswith'. (log.exceptionautomatically includes the full traceback when used in an exception handler, no additional arguments required.)I suspect that more cogs do this, so I think it's a good idea to check all the cogs after the Django migration is completed to change the log methods to
log.exceptioninside exception handlers where appropriate.Example from the
cogscog (it's both inmasteranddjango):bot/bot/cogs/cogs.py
Line 85 in 5e16f4a
bot/bot/cogs/cogs.py
Line 85 in 25640ad