/** * The daemon log sink — the trust boundary where a REDACTED log record is * forwarded to the selected remote shipper (syslog or OTLP). Info/warn/error * already reach daemon.log through the stdout/stderr tee; this sink queues the * otherwise-silent debug level to that file too. Duplicating routine records * into SQLite made high-volume sync/query logging block the event loop, so only * low-volume warning/error diagnostics remain in SQLite. */ import { type CanonicalLogRecord, type LogLevel, type LogRecord } from '@origintrail-official/dkg-core'; import { type DebugLogRecord } from './daemon-log-file-writer.js'; type PersistedDiagnosticLogLevel = Extract; /** Minimal shape of a remote log shipper (LogPushWorker / OtlpLogWorker). */ export interface RemoteLogShipper { push: (record: LogRecord) => void; } export interface DaemonLogSinkDeps { /** Queue an unredacted debug record for the local file-backed daemon log. */ writeLocalDebug: (record: DebugLogRecord) => void; /** Persist a FULL (un-redacted) warning/error record to the local DB. */ insertDiagnosticLog: (rec: { ts: number; level: PersistedDiagnosticLogLevel; operation_name?: string | null; operation_id?: string | null; module: string; message: string; }) => void; /** Redactor applied to the copy that leaves the node. */ redact: (record: CanonicalLogRecord) => CanonicalLogRecord; /** The currently selected shipper, evaluated per record for runtime toggles. */ remoteShipper: () => RemoteLogShipper | null | undefined; /** Clock, injectable for tests. Defaults to Date.now. */ now?: () => number; } /** * Build the `Logger.setSink` callback. Forwards one redacted copy to the * selected shipper and does no redaction work when export is disabled. */ export declare function createDaemonLogSink(deps: DaemonLogSinkDeps): (entry: CanonicalLogRecord) => void; export {}; //# sourceMappingURL=log-sink.d.ts.map