@intutic/logger 3.0.4 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @intutic/logger
|
|
2
|
+
|
|
3
|
+
Structured JSON logging for Intutic packages, built on [pino](https://getpino.io), with the active OpenTelemetry trace attached to each line.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createLogger } from '@intutic/logger'
|
|
7
|
+
|
|
8
|
+
const log = createLogger('circuit-breaker')
|
|
9
|
+
log.info({ workspaceId: 'wk_abc123' }, 'Tool call evaluated')
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- `createLogger(name, bindings?)` returns a pino `Logger` (also exported as the `Logger` type) that writes one JSON object per line to standard output. `bindings` are key-value pairs added to every line. There are no file transports. The level is `info` unless `LOG_LEVEL` says otherwise.
|
|
13
|
+
- When a trace is active, its `trace_id` and `span_id` are added to the line.
|
|
14
|
+
- Set `PINO_DEST=stderr` to write to standard error instead. A process that keeps standard output for JSON-RPC frames, such as an MCP stdio server, needs this.
|
|
15
|
+
|
|
16
|
+
MIT licensed. Source: [github.com/intutic/intutic](https://github.com/intutic/intutic/tree/main/packages/logger).
|