BotMeriendo uses Python’s standardDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Melendo/BotMeriendo/llms.txt
Use this file to discover all available pages before exploring further.
logging module configured in src/utils/logger.py. Logs are written simultaneously to bot.log (in the project root working directory) and to stdout, making them accessible both as a persistent file and via docker compose logs. The entire logging setup happens at module import time — setup_logging() is called when logger.py is first imported, so the logger object is ready before any cog loads.
Log Format
All log records share the same format string and date format:| Field | Example | Description |
|---|---|---|
%(asctime)s | 2024-07-15 14:32:01 | Timestamp formatted as %Y-%m-%d %H:%M:%S |
%(levelname)-8s | INFO | Level name, left-aligned and padded to 8 characters |
%(name)s | bot | Logger name — bot for application code, discord.gateway for gateway events, etc. |
%(message)s | We have logged in as BotMeriendo#1234 | The log message |
Log Levels
BotMeriendo configures log levels per-namespace to surface application events while suppressing the high-volume internal chatter from the discord.py library.| Logger | Level | Effect |
|---|---|---|
Root logger (basicConfig) | INFO | Captures INFO and above from all loggers by default |
bot | INFO (inherited) | All application-level messages: startup, queue events, playback errors |
discord | WARNING | Suppresses discord.py’s verbose INFO internals (cache updates, rate-limit retries, etc.) |
discord.http | WARNING | Suppresses per-request HTTP debug logs from the REST client |
discord.gateway | INFO | Connection lifecycle events (heartbeats, reconnects) are kept — useful for diagnosing drops |
Handlers
Two handlers are attached at the root logger level bybasicConfig, so every log record that passes a level filter is written to both destinations:
FileHandler('bot.log')— Opensbot.login the current working directory in append mode. When running under Docker, the working directory is the project root (set in theDockerfile), so the file appears asbotMeriendo/bot.logon the host if you mount the directory as a volume.StreamHandler()— Writes tostdout. Docker captures this automatically, making records visible indocker compose logs.
Accessing Logs
Via Docker (recommended for production):--since 1h to limit to the last hour:
Full setup_logging() Implementation
The complete function from src/utils/logger.py:
if root_logger.handlers: root_logger.handlers = []) prevents duplicate log entries if the module is reloaded during development (e.g. via a cog hot-reload that re-imports the utils package). Without it, each reload would attach an additional pair of handlers and every message would be written two, three, or more times.