diff options
Diffstat (limited to 'bot/utils')
| -rw-r--r-- | bot/utils/checks.py | 4 | ||||
| -rw-r--r-- | bot/utils/decorators.py | 8 | ||||
| -rw-r--r-- | bot/utils/halloween/spookifications.py | 4 | ||||
| -rw-r--r-- | bot/utils/messages.py | 4 | ||||
| -rw-r--r-- | bot/utils/pagination.py | 4 |
5 files changed, 12 insertions, 12 deletions
diff --git a/bot/utils/checks.py b/bot/utils/checks.py index c8a03935..bc6e7111 100644 --- a/bot/utils/checks.py +++ b/bot/utils/checks.py @@ -1,5 +1,4 @@ import datetime -import logging from collections.abc import Callable, Container, Iterable from discord.ext.commands import ( @@ -12,10 +11,11 @@ from discord.ext.commands import ( Cooldown, CooldownMapping, ) +from pydis_core.utils.logging import get_logger from bot import constants -log = logging.getLogger(__name__) +log = get_logger(__name__) CODEJAM_CATEGORY_NAME = "Code Jam" diff --git a/bot/utils/decorators.py b/bot/utils/decorators.py index 1cbad504..5f647652 100644 --- a/bot/utils/decorators.py +++ b/bot/utils/decorators.py @@ -1,6 +1,5 @@ import asyncio import functools -import logging import random from asyncio import Lock from collections.abc import Callable, Container @@ -10,6 +9,7 @@ from weakref import WeakValueDictionary from discord import Colour, Embed from discord.ext import commands from discord.ext.commands import CheckFailure, Command, Context +from pydis_core.utils.logging import get_logger from bot.constants import Channels, ERROR_REPLIES, Month, WHITELISTED_CHANNELS from bot.utils import human_months, resolve_current_month @@ -17,7 +17,7 @@ from bot.utils.checks import in_whitelist_check ONE_DAY = 24 * 60 * 60 -log = logging.getLogger(__name__) +log = get_logger(__name__) class InChannelCheckFailure(CheckFailure): @@ -122,12 +122,12 @@ def in_month(*allowed_months: Month) -> Callable: def decorator(callable_: Callable) -> Callable: # Functions decorated as commands are turned into instances of `Command` if isinstance(callable_, Command): - logging.debug(f"Command {callable_.qualified_name} will be locked to {human_months(allowed_months)}") + log.debug(f"Command {callable_.qualified_name} will be locked to {human_months(allowed_months)}") actual_deco = in_month_command(*allowed_months) # D.py will assign this attribute when `callable_` is registered as a listener elif hasattr(callable_, "__cog_listener__"): - logging.debug(f"Listener {callable_.__qualname__} will be locked to {human_months(allowed_months)}") + log.debug(f"Listener {callable_.__qualname__} will be locked to {human_months(allowed_months)}") actual_deco = in_month_listener(*allowed_months) # Otherwise we're unsure exactly what has been decorated diff --git a/bot/utils/halloween/spookifications.py b/bot/utils/halloween/spookifications.py index 2f8c1448..78714a19 100644 --- a/bot/utils/halloween/spookifications.py +++ b/bot/utils/halloween/spookifications.py @@ -1,9 +1,9 @@ -import logging from random import choice, randint from PIL import Image, ImageOps +from pydis_core.utils.logging import get_logger -log = logging.getLogger() +log = get_logger() def inversion(im: Image.Image) -> Image.Image: diff --git a/bot/utils/messages.py b/bot/utils/messages.py index 4fb0b39b..fee3618f 100644 --- a/bot/utils/messages.py +++ b/bot/utils/messages.py @@ -1,13 +1,13 @@ import contextlib -import logging import re from collections.abc import Callable from discord import Embed, Message from discord.ext import commands from discord.ext.commands import Context, MessageConverter +from pydis_core.utils.logging import get_logger -log = logging.getLogger(__name__) +log = get_logger(__name__) def sub_clyde(username: str | None) -> str | None: diff --git a/bot/utils/pagination.py b/bot/utils/pagination.py index e5b887f1..b2da37ed 100644 --- a/bot/utils/pagination.py +++ b/bot/utils/pagination.py @@ -1,9 +1,9 @@ -import logging from collections.abc import Iterable from discord import Embed, Member, Reaction from discord.abc import User from discord.ext.commands import Context, Paginator +from pydis_core.utils.logging import get_logger from bot.constants import Emojis @@ -15,7 +15,7 @@ DELETE_EMOJI = Emojis.trashcan # [:trashcan:] PAGINATION_EMOJI = (FIRST_EMOJI, LEFT_EMOJI, RIGHT_EMOJI, LAST_EMOJI, DELETE_EMOJI) -log = logging.getLogger(__name__) +log = get_logger(__name__) class EmptyPaginatorEmbedError(Exception): |