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