mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2026-11-08 10:51:18 -05:00
stateful logging
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user