diff options
author | 2019-09-24 10:27:50 -0700 | |
---|---|---|
committer | 2019-09-24 10:27:50 -0700 | |
commit | 21bb8d76917101b62dd8741ca815396c969704f5 (patch) | |
tree | 392293ef8e69f62e50bc81987543e56cb2b9a205 | |
parent | Docker Build & CI Refinements (#444) (diff) | |
parent | Merge branch 'master' into master (diff) |
Merge pull request #443 from Akarys42/master
Change log.error to log.exception
-rw-r--r-- | bot/cogs/cogs.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/bot/cogs/cogs.py b/bot/cogs/cogs.py index 117c77d4b..1f6ccd09c 100644 --- a/bot/cogs/cogs.py +++ b/bot/cogs/cogs.py @@ -74,13 +74,12 @@ class Cogs(Cog): try: self.bot.load_extension(full_cog) except ImportError: - log.error(f"{ctx.author} requested we load the '{cog}' cog, " - f"but the cog module {full_cog} could not be found!") + log.exception(f"{ctx.author} requested we load the '{cog}' cog, " + f"but the cog module {full_cog} could not be found!") embed.description = f"Invalid cog: {cog}\n\nCould not find cog module {full_cog}" except Exception as e: - log.error(f"{ctx.author} requested we load the '{cog}' cog, " - "but the loading failed with the following error: \n" - f"**{e.__class__.__name__}: {e}**") + log.exception(f"{ctx.author} requested we load the '{cog}' cog, " + "but the loading failed") embed.description = f"Failed to load cog: {cog}\n\n{e.__class__.__name__}: {e}" else: log.debug(f"{ctx.author} requested we load the '{cog}' cog. Cog loaded!") @@ -129,9 +128,8 @@ class Cogs(Cog): try: self.bot.unload_extension(full_cog) except Exception as e: - log.error(f"{ctx.author} requested we unload the '{cog}' cog, " - "but the unloading failed with the following error: \n" - f"{e}") + log.exception(f"{ctx.author} requested we unload the '{cog}' cog, " + "but the unloading failed") embed.description = f"Failed to unload cog: {cog}\n\n```{e}```" else: log.debug(f"{ctx.author} requested we unload the '{cog}' cog. Cog unloaded!") @@ -234,9 +232,8 @@ class Cogs(Cog): self.bot.unload_extension(full_cog) self.bot.load_extension(full_cog) except Exception as e: - log.error(f"{ctx.author} requested we reload the '{cog}' cog, " - "but the unloading failed with the following error: \n" - f"{e}") + log.exception(f"{ctx.author} requested we reload the '{cog}' cog, " + "but the unloading failed") embed.description = f"Failed to reload cog: {cog}\n\n```{e}```" else: log.debug(f"{ctx.author} requested we reload the '{cog}' cog. Cog reloaded!") |