refactor: structured logging across server

Create server/src/lib/logger.ts with info/warn/error methods that add
[botfights:tag] timestamps. Replace bare console.log/warn/error calls
in index.ts, seed.ts, routes/fights.ts, engine/queue.ts, engine/mock.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-08 20:41:23 +00:00
co-authored by Claude Opus 4.6
parent 7bd110684d
commit f62323c59f
6 changed files with 42 additions and 18 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import '../src/db/index.js'
import { logger } from './lib/logger.js'
import { seedMockBots, seedMockFights } from './engine/mock.js'
async function main() {
@@ -8,8 +9,8 @@ async function main() {
await seedMockBots()
await seedMockFights(15)
console.log('[botfights] seed complete!')
logger.info('seed', 'seed complete!')
process.exit(0)
}
main().catch(console.error)
main().catch((err) => logger.error('seed', 'seed failed', err))