Skip to content

Commit d81a65e

Browse files
committed
Use pydis core logging
1 parent 5148ad7 commit d81a65e

File tree

7 files changed

+14
-16
lines changed

7 files changed

+14
-16
lines changed

bot/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import dataclasses
22
import enum
3-
import logging
43
from datetime import UTC, datetime
54
from os import environ
65

76
from pydantic_settings import BaseSettings
7+
from pydis_core.utils import logging
88

9-
log = logging.getLogger(__name__)
9+
log = logging.get_logger(__name__)
1010

1111

1212
class EnvConfig(

bot/exts/advent_of_code/_cog.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import json
2-
import logging
32
from datetime import UTC, datetime, timedelta
43
from pathlib import Path
54

65
import arrow
76
import discord
87
from discord import app_commands
98
from discord.ext import commands, tasks
10-
from pydis_core.utils import scheduling
9+
from pydis_core.utils import logging, scheduling
1110

1211
from bot.bot import SirRobin
1312
from bot.constants import (
@@ -25,7 +24,7 @@
2524
from bot.utils import members
2625
from bot.utils.decorators import in_month, in_whitelist, with_role
2726

28-
log = logging.getLogger(__name__)
27+
log = logging.get_logger(__name__)
2928

3029
AOC_REQUEST_HEADER = {"user-agent": "PythonDiscord AoC Event Bot"}
3130

bot/exts/advent_of_code/_helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import collections
33
import datetime
44
import json
5-
import logging
65
import math
76
import operator
87
from typing import Any
@@ -11,14 +10,14 @@
1110
import arrow
1211
import discord
1312
from discord.ext import commands
14-
from pydis_core.utils import paste_service
13+
from pydis_core.utils import logging, paste_service
1514

1615
import bot
1716
from bot.bot import SirRobin
1817
from bot.constants import AdventOfCode, Bot, Channels, Colours, Roles
1918
from bot.exts.advent_of_code import _caches
2019

21-
log = logging.getLogger(__name__)
20+
log = logging.get_logger(__name__)
2221

2322
# Base API URL for Advent of Code Private Leaderboards
2423
AOC_API_URL = "https://adventofcode.com/{year}/leaderboard/private/view/{leaderboard_id}.json"

bot/exts/summer_aoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import logging
32
from datetime import timedelta
43
from typing import Literal
54

@@ -8,12 +7,13 @@
87
from async_rediscache import RedisCache
98
from discord.ext import commands, tasks
109
from discord.utils import MISSING
10+
from pydis_core.utils import logging
1111

1212
from bot.bot import SirRobin
1313
from bot.constants import Bot, Channels, Roles
1414
from bot.utils.time import time_until
1515

16-
log = logging.getLogger(__name__)
16+
log = logging.get_logger(__name__)
1717

1818
AOC_URL = "https://adventofcode.com/{year}/day/{day}"
1919
LAST_DAY = 25

bot/utils/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import asyncio
22
import functools
3-
import logging
43
from collections.abc import Callable, Container
54

65
from discord.ext import commands
76
from discord.ext.commands import Command, Context
7+
from pydis_core.utils import logging
88

99
from bot.constants import Channels, Month
1010
from bot.utils import human_months, resolve_current_month
@@ -13,7 +13,7 @@
1313

1414
ONE_DAY = 24 * 60 * 60
1515

16-
log = logging.getLogger(__name__)
16+
log = logging.get_logger(__name__)
1717

1818

1919
def seasonal_task(*allowed_months: Month, sleep_time: float | int = ONE_DAY) -> Callable:

bot/utils/members.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import logging
21
import typing as t
32

43
import discord
4+
from pydis_core.utils import logging
55

6-
log = logging.getLogger(__name__)
6+
log = logging.get_logger(__name__)
77

88

99
async def get_or_fetch_member(guild: discord.Guild, member_id: int) -> discord.Member | None:

bot/utils/pagination.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import logging
21
from collections.abc import Iterable
32

43
from discord import Embed, Member, Reaction
54
from discord.abc import User
65
from discord.ext.commands import Context, Paginator
6+
from pydis_core.utils import logging
77

88
from bot.constants import Emojis
99

@@ -15,7 +15,7 @@
1515

1616
PAGINATION_EMOJI = (FIRST_EMOJI, LEFT_EMOJI, RIGHT_EMOJI, LAST_EMOJI, DELETE_EMOJI)
1717

18-
log = logging.getLogger(__name__)
18+
log = logging.get_logger(__name__)
1919

2020

2121
class EmptyPaginatorEmbedError(Exception):

0 commit comments

Comments
 (0)