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
+8 -1
View File
@@ -1,5 +1,6 @@
import { event, Events } from '../utils/index.js'
import commands from '../commands/index.js'
import { createLogger } from '../components/index.js'
/**
* Interaction creation listener for the client
@@ -15,5 +16,11 @@ export default event(Events.InteractionCreate, async ({ logger, client }, intera
if (!command) return
// the command exists, execute it
command.run(client, interaction, logger)
const commandLogger = createLogger({
component: 'command',
command: command.name
}, logger)
void Promise.resolve(command.run(client, interaction, commandLogger))
.catch(error => commandLogger.error({ err: error }, 'Command execution failed'))
})