/** * Replace the active log transports. Pass `console: true, file: false` for * long-running services (the auth broker, etc.) that want their structured * logs piped into a process supervisor instead of the rotating file. */ export declare function setTransports(opts: { console?: boolean; file?: boolean | string; }): void; /** * Log an error message. * @param message - The message to log. * @param context - The context to log. */ export declare function error(message: string, context?: Record): void; /** * Log a warning message. * @param message - The message to log. * @param context - The context to log. */ export declare function warn(message: string, context?: Record): void; /** * Log an informational message. * @param message - The message to log. * @param context - The context to log. */ export declare function info(message: string, context?: Record): void; /** * Log a debug message. * @param message - The message to log. * @param context - The context to log. */ export declare function debug(message: string, context?: Record): void; /** * Streaming startup markers, enabled by `PI_DEBUG_STARTUP`. Unlike the * PI_TIMING tree (printed only after startup completes), these write one * synchronous stderr line as each phase begins/ends, so a hard hang still * shows the last phase that started. `fs.writeSync(2)` is used deliberately: * it cannot be reordered or buffered past a synchronous block of the event * loop (dlopen, sync fs on a dead mount, spawnSync). */ export declare function startupMarker(text: string): void; export declare function timingModeIncludes(option: "full" | "x"): boolean; export declare function shouldExitAfterTimings(): boolean; /** * Print collected timings as an indented tree. * Each span shows wall duration; parents with children also show "(self)" for unattributed time. * Sibling spans are sorted by start time. Spans whose intervals overlap with siblings ran in parallel. */ export declare function printTimings(): void; /** * Begin recording startup timings under a new root span. * Idempotent: a second call while already recording is a no-op, so an explicit * starter (main.ts) and any future early starter can coexist. */ export declare function startTiming(): void; /** * Record an externally-measured span as a leaf child of the active span (or root * when no span is active). Used by {@link spliceModuleLoadBuffer} to fold * preload-captured module windows into the tree. */ export declare function recordModuleLoadSpan(path: string, start: number, durationMs: number, bodyMs?: number, imports?: string[]): void; /** * End timing window and clear buffers. */ export declare function endTiming(): void; /** * Ops of the currently-open span chain (root → deepest), following the most * recently started unfinished child at each level. Lets a startup watchdog * name the phase a stalled startup is stuck in. */ export declare function openSpanPath(): string[]; /** * Time a span. Three forms: * time(op) — point event (zero-duration breadcrumb) * time(op, fn, ...args) — wrap fn in a span; returns fn's return value (sync or Promise) * * Spans nest hierarchically via AsyncLocalStorage: a child started inside another span's fn * (even across awaits) becomes that span's child. Parallel children are recorded as siblings * with overlapping intervals. */ export declare function time(op: string): void; export declare function time(op: string, fn: (...args: A) => T, ...args: A): T;