@@ -12,7 +12,7 @@ import path from "node:path";
1212import { fileURLToPath } from "node:url" ;
1313import { initializeConfig } from "@/client/init-hooks" ;
1414import { resolveConfig } from "@/client/config-loader/resolve-config.node" ;
15- import { getClientLogger } from "@/logging" ;
15+ import { getClientLogger , getLogger , SDK_SERVER_NAMESPACE } from "@/logging" ;
1616import {
1717 BareRuntimeBinaryNotFoundError ,
1818 RPCInitTimeoutError ,
@@ -25,6 +25,9 @@ const RPC_INIT_TIMEOUT_MS = 30_000;
2525const WORKER_STDERR_TAIL_CHARS = 16_384 ;
2626
2727const logger = getClientLogger ( ) ;
28+ // Addons route real logs through their JS callback; anything written straight to the
29+ // worker's stderr is treated as debug.
30+ const workerLogger = getLogger ( SDK_SERVER_NAMESPACE , { enableConsole : false } ) ;
2831
2932let rpcInstance : RPC | null = null ;
3033let rpcPromise : Promise < RPC > | null = null ;
@@ -418,7 +421,9 @@ async function ensureRPC(): Promise<RPC> {
418421 getWorkerStderr ( bareWorkerProc ) ?. on ( "data" , ( chunk ) => {
419422 const text = chunk . toString ( ) ;
420423 workerStderrTail = appendWorkerStderrTail ( workerStderrTail , text ) ;
421- process . stderr . write ( chunk ) ;
424+ for ( const line of text . split ( "\n" ) ) {
425+ if ( line . trim ( ) ) workerLogger . debug ( line ) ;
426+ }
422427 } ) ;
423428
424429 bareWorkerProc . on (
0 commit comments