fix(aurora): override aiosqlite
's logging level to warning
This commit is contained in:
parent
5cbf4e7e47
commit
eebddd6e89
1 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
# |_____/ \___|\__,_|___/ \_/\_/ |_|_| |_| |_|_| |_| |_|\___|_|
|
# |_____/ \___|\__,_|___/ \_/\_/ |_|_| |_| |_|_| |_| |_|\___|_|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import logging as py_logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
|
@ -81,6 +82,12 @@ class Aurora(commands.Cog):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
register_config(config)
|
register_config(config)
|
||||||
self.handle_expiry.start()
|
self.handle_expiry.start()
|
||||||
|
# If we don't override aiosqlite's logging level, it will spam the console with dozens of debug messages per query.
|
||||||
|
# This is unnecessary because Aurora already logs all of its SQL queries (or at least, most of them),
|
||||||
|
# and the information that aiosqlite logs is not useful to the bot owner.
|
||||||
|
# This is a bad solution though as it overrides it for any other cogs that are using aiosqlite too.
|
||||||
|
# If there's a better solution that you're aware of, please let me know in Discord or in a CoastalCommits issue.
|
||||||
|
py_logging.getLogger('aiosqlite').setLevel(py_logging.WARNING)
|
||||||
|
|
||||||
def format_help_for_context(self, ctx: commands.Context) -> str:
|
def format_help_for_context(self, ctx: commands.Context) -> str:
|
||||||
pre_processed = super().format_help_for_context(ctx) or ""
|
pre_processed = super().format_help_for_context(ctx) or ""
|
||||||
|
|
Loading…
Reference in a new issue