Jelajahi Sumber

docs: fix logging example for plugin (#11989)

Tomáš Linhart 2 bulan lalu
induk
melakukan
0a5d5bc524
1 mengubah file dengan 6 tambahan dan 4 penghapusan
  1. 6 4
      packages/web/src/content/docs/plugins.mdx

+ 6 - 4
packages/web/src/content/docs/plugins.mdx

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