aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Akarys42 <[email protected]>2019-09-22 17:07:41 +0200
committerGravatar Akarys42 <[email protected]>2019-09-22 17:07:41 +0200
commit0848d6003928f07edc9c59115cc72b075e5b8330 (patch)
tree3086f01dcedf1e38dfc35baacb89e55c461acf83
parentUpdate off_topic_names.py (diff)
Change log.error to log.exception
See issue #382
-rw-r--r--bot/cogs/cogs.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/bot/cogs/cogs.py b/bot/cogs/cogs.py
index 5bef52c0a..b82273978 100644
--- a/bot/cogs/cogs.py
+++ b/bot/cogs/cogs.py
@@ -78,13 +78,12 @@ class Cogs:
try:
self.bot.load_extension(full_cog)
except ImportError:
- log.error(f"{ctx.author} requested we load the '{cog}' cog, "
+ 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}")
+ 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}```"
else:
log.debug(f"{ctx.author} requested we load the '{cog}' cog. Cog loaded!")
@@ -134,9 +133,8 @@ class Cogs:
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!")
@@ -239,9 +237,8 @@ class Cogs:
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!")