stateful logging

This commit is contained in:
JT2M0L3Y
2026-10-21 20:22:36 -07:00
parent 288c0eb08f
commit 7df5d14e28
16 changed files with 187 additions and 41 deletions
+19
View File
@@ -42,4 +42,23 @@ describe('Pino logger', () => {
expect(entry.answer).toBe(42)
expect(entry.msg).toBe('warning')
})
it('preserves parent context when adding command bindings', () => {
output = ''
const eventLogger = createLogger({
component: 'event',
event: 'InteractionCreate'
}, parentLogger)
const commandLogger = createLogger({
component: 'command',
command: 'summary'
}, eventLogger)
commandLogger.info('command started')
const entry = JSON.parse(output)
expect(entry.component).toBe('command')
expect(entry.event).toBe('InteractionCreate')
expect(entry.command).toBe('summary')
})
})