implement pino poc

This commit is contained in:
JT2M0L3Y
2026-10-21 19:09:28 -07:00
parent 99db6d8163
commit 217291e531
22 changed files with 332 additions and 97 deletions
+15
View File
@@ -23,6 +23,21 @@ These are guides to the features and capabilities of this app.
* [User Slash Commands](./docs/commands-guide.md)
* [Client Events](./docs/events-guide.md)
## Logging
The application uses Pino child loggers with structured component metadata.
Outside production, `pino-caller` adds the source file and line to each log
entry. Set `LOG_LEVEL` to configure the minimum level (defaults to `info`).
```ts
import { createLogger } from './components/index.js'
const logger = createLogger({ component: 'client' })
logger.info({ username }, 'Client started')
```
Log entries are JSON and include the structured fields provided to the log
method, along with `component` and (outside production) `caller`.
## Environment Setup
* Clone this repo using `git clone https://github.com/kevinthedang/discord-ollama.git` or just use [GitHub Desktop](https://desktop.github.com/) to clone the repo.
* You will need a `.env` file in the root of the project directory with the bot's token. There is a `.env.sample` is provided for you as a reference for what environment variables.