docs: fix logging example for plugin (#11989)

This commit is contained in:
Tomáš Linhart
2026-02-03 22:21:15 +01:00
committed by GitHub
parent a30696f9bf
commit 0a5d5bc524

View File

@@ -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" },
},
}) })
} }
``` ```