feat: implement branded discord embeds and versioning

This commit is contained in:
syntaxbullet
2026-01-14 16:10:23 +01:00
parent 6e57ab07e4
commit 4af2690bab
13 changed files with 291 additions and 9 deletions

View File

@@ -0,0 +1,31 @@
### Context & Goal
The bot currently relies on `console.error` which is hard to track and lacks context. A centralized error logging service will allow for better debugging, persistent error logs, and future integration with services like Sentry or Discord webhooks for alerts.
### Dependencies
- None
### Affected Files
- `shared/lib/logger.ts`: New file for the unified logger service.
- `bot/lib/handlers/CommandHandler.ts`: Update to use the new logger for command errors.
- `web/src/server.ts`: Update to use the new logger for API and WebSocket errors.
### Technical Constraints & Strategy
- Implementation: Create a `Logger` class/object in `shared/lib`.
- Support log levels: `info`, `warn`, `error`, `debug`.
- Errors should capture: timestamp, source (bot/web), error message, and stack trace if available.
- For now, logging to console and a local log file (e.g., `logs/error.log`) is sufficient.
### Definition of Done (Binary)
- [ ] `Logger` service implemented in `shared/lib/logger.ts`.
- [ ] Command errors are logged via the new service.
- [ ] Web server errors are logged via the new service.
- [ ] Log output is formatted consistently.
### New Test Files
- `shared/lib/logger.test.ts`: Verify logger output and file writing.