docs: fix logging example for plugin (#11989)
parent
a30696f9bf
commit
0a5d5bc524
|
|
@ -317,10 +317,12 @@ Use `client.app.log()` instead of `console.log` for structured logging:
|
||||||
```ts title=".opencode/plugins/my-plugin.ts"
|
```ts title=".opencode/plugins/my-plugin.ts"
|
||||||
export const MyPlugin = async ({ client }) => {
|
export const MyPlugin = async ({ client }) => {
|
||||||
await client.app.log({
|
await client.app.log({
|
||||||
service: "my-plugin",
|
body: {
|
||||||
level: "info",
|
service: "my-plugin",
|
||||||
message: "Plugin initialized",
|
level: "info",
|
||||||
extra: { foo: "bar" },
|
message: "Plugin initialized",
|
||||||
|
extra: { foo: "bar" },
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue