MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / logJson

Function logJson

src/agents/claude-code.ts:23–35  ·  view source on GitHub ↗
(value: unknown, options: Agent.RunOptions)

Source from the content-addressed store, hash-verified

21}
22
23function logJson(value: unknown, options: Agent.RunOptions): void {
24 let message: string;
25 try {
26 message = JSON.stringify(value);
27 } catch (error) {
28 message = JSON.stringify({
29 error: "serialization_failed",
30 reason: error instanceof Error ? error.message : String(error),
31 });
32 }
33
34 process.stdout.write(`${options.logger.format(message)}\n`);
35}
36
37function logError(value: unknown, options: Agent.RunOptions): void {
38 let message: string;

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected