Simplify logger setup

This commit is contained in:
2025-08-10 07:41:41 -07:00
parent 0a5dcc6701
commit 13e1a983d9
2 changed files with 3 additions and 7 deletions

View File

@@ -16,7 +16,6 @@ Features:
import discord
from discord.ext import commands, tasks
from discord import app_commands
import os
import aiohttp
import asyncio
import json
@@ -33,15 +32,12 @@ import generate_config
# LOGGING SETUP
# ==============================================
logs_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logs')
os.makedirs(logs_dir, exist_ok=True)
logger = logging.getLogger('pterodisbot')
logger.setLevel(logging.DEBUG)
# File handler for logs (rotates when reaching 5MB, keeps 3 backups)
handler = RotatingFileHandler(
filename=os.path.join(logs_dir, 'pterodisbot.log'),
'./logs/pterodisbot.log',
maxBytes=5*1024*1024, # 5 MiB max log file size
backupCount=3, # Rotate through 3 files
encoding='utf-8'