import { RedactionValidatorInstance } from "../redaction/types.js"; import { AISpan, LogLevel, Logger, Sensitivity } from "@graphorin/core"; //#region src/logger/logger.d.ts /** * @stable */ type LoggerFormat = 'json' | 'pretty'; /** * Configuration shape for {@link createLogger}. * * @stable */ interface LoggerOptions { readonly level?: LogLevel; readonly format?: LoggerFormat; /** Optional validator. Logger fields flow through `validate(...)`. */ readonly redaction?: RedactionValidatorInstance; /** Default sensitivity tier for fields. Defaults to `'internal'`. */ readonly defaultTier?: Sensitivity; /** * Sink that receives the rendered line. Defaults to writing to the * appropriate `console.*` method. */ readonly sink?: (level: LogLevel, line: string) => void; } /** * Run `fn` with the supplied span as the "current" log-correlation * span. The logger picks up the trace + span ids automatically. * * @stable */ declare function withCurrentSpan(span: AISpan | undefined, fn: () => R | Promise): R | Promise; /** * Read the current span context (if any). Useful for callers that * want to attach span metadata to bespoke records. * * @stable */ declare function getCurrentSpanContext(): { readonly traceId: string; readonly spanId: string; } | undefined; /** * Build a {@link Logger} configured against the supplied options. * * @stable */ declare function createLogger(opts?: LoggerOptions): Logger; //#endregion export { LoggerFormat, LoggerOptions, createLogger, getCurrentSpanContext, withCurrentSpan }; //# sourceMappingURL=logger.d.ts.map