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:
co-authored by
Claude Opus 4.6
parent
7bd110684d
commit
f62323c59f
+3
-2
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user