UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

5 lines • 1.61 kB
import{o as resolveGlobalSingleton}from"./global-singleton-DolL9xGt.mjs";import{V as readLoggingConfig}from"./redact-BT59pdZ_.mjs";import{t as captureSecretRedactionRegistrySnapshot}from"./secret-redaction-registry-DospXE4m.mjs";import{o as resolveRuntimeProcessEntrypointUrl}from"./runtime-process-url-DJ272Tuo.mjs";import{o as getResolvedLoggerFileTarget}from"./logger-bB_ZfEX5.mjs";import{t as WorkerTaskPool}from"./worker-task-pool-Bg54sSAN.mjs";import{Ui as validateLogsTailParams}from"./src-BDZMFmKa.mjs";import{i as ErrorCodes}from"./missing-scope-error-CkgBgh6d.mjs";import{p as errorShape}from"./error-codes-CQNGhXT-.mjs";import{r as defineValidatedGatewayMethod}from"./validation-CM41YclJ.mjs"; //!src/logging/log-tail-worker.ts async function readConfiguredLogTailInWorker(e){const t=await getResolvedLoggerFileTarget();const n=resolveGlobalSingleton(Symbol.for(`openclaw.logTailWorker`),()=>({}),async e=>{await e.pool?.close();e.pool=void 0});const r=n.pool??=new WorkerTaskPool({workerUrl:resolveRuntimeProcessEntrypointUrl(`fileLog`),workerClass:`singleton`,maxPendingTasks:8});const i={type:`tail`,target:t,params:e,redactPatterns:readLoggingConfig()?.redactPatterns,secrets:captureSecretRedactionRegistrySnapshot()};return r.run(i,{inputBytes:Buffer.byteLength(JSON.stringify(i))})} //!src/gateway/server-methods/logs.ts const logsHandlers={"logs.tail":defineValidatedGatewayMethod(`logs.tail`,validateLogsTailParams,async({params:e,respond:t})=>{t(true,await readConfiguredLogTailInWorker(e),void 0)},e=>errorShape(ErrorCodes.UNAVAILABLE,`log read failed: ${String(e)}`))};export{logsHandlers};