/** * Engine Logger * * Module-level logger interface for the records-validator engine. Lets * the engine emit diagnostics without binding directly to the server's * Winston logger — a precondition for extracting the engine into a * standalone npm package (S-2 in the validation-engine roadmap). * * ## Wiring * * Engine modules import the singleton `logger` from this file. By * default it forwards only errors to a console-backed implementation. Embedders call * `setEngineLogger()` once during boot to route logging through their own * Winston/pino/etc. instance: * * ```ts * import { setEngineLogger } from '@records-fhir/validator'; * setEngineLogger(appLogger); * ``` * * The engine never reaches into server code; this file is the entire * coupling boundary for logging. */ /** * Minimal logger contract the engine relies on. Designed to be * trivially satisfied by Winston, pino, console, or a noop logger — * the second argument is intentionally untyped to accept the variety * of meta payloads existing engine call sites emit (Error instances, * plain objects, scalars). */ export interface EngineLogger { debug(message: string, meta?: unknown): void; info(message: string, meta?: unknown): void; warn(message: string, meta?: unknown): void; error(message: string | Error, meta?: unknown): void; } export type EngineLogLevel = 'silent' | 'error' | 'warn' | 'info' | 'debug'; /** * Replace the engine's underlying logger. Intended to be called once * during embedder bootstrap. Calling more than once is supported but * not expected in production — later writes simply replace earlier * ones. */ export declare function setEngineLogger(next: EngineLogger): void; /** * The shared logger every engine module imports. Delegates to whatever * `setEngineLogger` last installed (or the filtered console default when an * embedder hasn't wired anything up). Set RECORDS_FHIR_VALIDATOR_LOG_LEVEL * or RECORDS_VALIDATOR_LOG_LEVEL to silent, error, warn, info, or debug to * adjust that default console logger. * * The wrapper is created once and re-reads `activeLogger` on every * call, so installing a logger after engine modules have already * captured `logger` still routes correctly. */ export declare const logger: EngineLogger; //# sourceMappingURL=logger.d.ts.map