import type { Event } from "../event.js"; import { Level } from "../level.js"; import type { SpanAttributes } from "../span.js"; import { ManagedSubscriber } from "./ManagedSubscriber.js"; /** * Options for the FmtSubscriber. */ export type FmtSubscriberOptions = { /** * The minimum level of logs to display. * * @default Level.INFO */ level?: Level; /** * Include a timestamp in the message. * * @default true */ timestamp?: boolean; /** * Log messages in color. * * Defaults to true if supported by the terminal environment. * * @default true */ color?: boolean; /** * Abbreviate long field values. * * @default false */ abbreviateLongFieldValues?: boolean | number; }; /** * The FmtSubscriber class is a subscriber which logs events to the console in a human-readable format. * * @example * ```ts * import { FmtSubscriber } from "@bcheidemann/tracing"; * * // Initialize the subscriber and set it as the default global subscriber * // This should be called at the beginning of your program * FmtSubscriber.setGlobalDefault(); * ``` */ export declare class FmtSubscriber extends ManagedSubscriber { private readonly options; private color; constructor(options?: FmtSubscriberOptions); /** * Initialises the FmtSubscriber as the default global subscriber. * * @deprecated Use `FmtSubscriber.setGlobalDefault()` instead */ static init(options?: FmtSubscriberOptions): FmtSubscriber; static setGlobalDefault(options?: FmtSubscriberOptions): FmtSubscriber; protected onEvent(event: Event, spans: SpanAttributes[]): void; private displayMessage; private displayLevel; private displayTimestamp; private get timestamp(); private displaySpans; private displaySpan; private displayEventFields; private displaySpanFields; private flattenFields; private displayValue; } //# sourceMappingURL=FmtSubscriber.d.ts.map