diff options
| author | 2020-03-26 10:56:01 -0400 | |
|---|---|---|
| committer | 2020-03-26 11:30:57 -0400 | |
| commit | 4d33b9f863bb54e69b9530a1ee05e4068cafa9a6 (patch) | |
| tree | 91c2d40dbc9dd5816ce377a98d24f0262289baab | |
| parent | Change Alias warnings to info (diff) | |
Initial pass on log severity reduction
With the updated definition on logging levels, there are a few events that were issuing logs at too high of a level.
This also includes some kaizening of existing log messages.
| -rw-r--r-- | bot/bot.py | 4 | ||||
| -rw-r--r-- | bot/cogs/alias.py | 2 | ||||
| -rw-r--r-- | bot/cogs/bot.py | 1 | ||||
| -rw-r--r-- | bot/cogs/moderation/scheduler.py | 2 | ||||
| -rw-r--r-- | bot/cogs/moderation/superstarify.py | 4 | ||||
| -rw-r--r-- | bot/cogs/snekbox.py | 2 | ||||
| -rw-r--r-- | bot/converters.py | 2 |
7 files changed, 8 insertions, 9 deletions
diff --git a/bot/bot.py b/bot/bot.py index 950ac6751..3e1b31342 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -77,7 +77,7 @@ class Bot(commands.Bot): # Its __del__ does send a warning but it doesn't always show up for some reason. if self._connector and not self._connector._closed: - log.warning( + log.info( "The previous connector was not closed; it will remain open and be overwritten" ) @@ -94,7 +94,7 @@ class Bot(commands.Bot): # Its __del__ does send a warning but it doesn't always show up for some reason. if self.http_session and not self.http_session.closed: - log.warning( + log.info( "The previous session was not closed; it will remain open and be overwritten" ) diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py index 9001e18f0..55c7efe65 100644 --- a/bot/cogs/alias.py +++ b/bot/cogs/alias.py @@ -29,7 +29,7 @@ class Alias (Cog): return log.info(f'Did not find command "{cmd_name}" to invoke.') elif not await cmd.can_run(ctx): return log.info( - f'{str(ctx.author)} tried to run the command "{cmd_name}"' + f'{str(ctx.author)} tried to run the command "{cmd_name}" but lacks permission.' ) await ctx.invoke(cmd, *args, **kwargs) diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py index f17135877..e897b30ff 100644 --- a/bot/cogs/bot.py +++ b/bot/cogs/bot.py @@ -67,7 +67,6 @@ class BotCog(Cog, name="Bot"): icon_url=URLs.bot_avatar ) - log.info(f"{ctx.author} called !about. Returning information about the bot.") await ctx.send(embed=embed) @command(name='echo', aliases=('print',)) diff --git a/bot/cogs/moderation/scheduler.py b/bot/cogs/moderation/scheduler.py index f0b6b2c48..917697be9 100644 --- a/bot/cogs/moderation/scheduler.py +++ b/bot/cogs/moderation/scheduler.py @@ -222,7 +222,7 @@ class InfractionScheduler(Scheduler): # If multiple active infractions were found, mark them as inactive in the database # and cancel their expiration tasks. if len(response) > 1: - log.warning( + log.info( f"Found more than one active {infr_type} infraction for user {user.id}; " "deactivating the extra active infractions too." ) diff --git a/bot/cogs/moderation/superstarify.py b/bot/cogs/moderation/superstarify.py index 893cb7f13..ca3dc4202 100644 --- a/bot/cogs/moderation/superstarify.py +++ b/bot/cogs/moderation/superstarify.py @@ -59,7 +59,7 @@ class Superstarify(InfractionScheduler, Cog): return # Nick change was triggered by this event. Ignore. log.info( - f"{after.display_name} is currently in superstar-prison. " + f"{after.display_name} ({after.id}) tried to escape superstar prison. " f"Changing the nick back to {before.display_name}." ) await after.edit( @@ -80,7 +80,7 @@ class Superstarify(InfractionScheduler, Cog): ) if not notified: - log.warning("Failed to DM user about why they cannot change their nickname.") + log.info("Failed to DM user about why they cannot change their nickname.") @Cog.listener() async def on_member_join(self, member: Member) -> None: diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py index cff7c5786..b65b146ea 100644 --- a/bot/cogs/snekbox.py +++ b/bot/cogs/snekbox.py @@ -281,7 +281,7 @@ class Snekbox(Cog): code = await self.continue_eval(ctx, response) if not code: break - log.info(f"Re-evaluating message {ctx.message.id}") + log.info(f"Re-evaluating code from message {ctx.message.id}:\n{code}") def predicate_eval_message_edit(ctx: Context, old_msg: Message, new_msg: Message) -> bool: diff --git a/bot/converters.py b/bot/converters.py index 1945e1da3..98f4e33c8 100644 --- a/bot/converters.py +++ b/bot/converters.py @@ -323,7 +323,7 @@ class FetchedUser(UserConverter): except discord.HTTPException as e: # If the Discord error isn't `Unknown user`, return a proxy instead if e.code != 10013: - log.warning(f"Failed to fetch user, returning a proxy instead: status {e.status}") + log.info(f"Failed to fetch user, returning a proxy instead: status {e.status}") return proxy_user(arg) log.debug(f"Failed to fetch user {arg}: user does not exist.") |