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"
export const MyPlugin = async ({ client }) => {
await client.app.log({
service: "my-plugin",
level: "info",
message: "Plugin initialized",
extra: { foo: "bar" },
body: {
service: "my-plugin",
level: "info",
message: "Plugin initialized",
extra: { foo: "bar" },
},
})
}
```