/** * Shared logger formatting utilities. * This module contains pure formatting functions with no external dependencies, * enabling reuse between the main logger and proxy logger. * * @module */ export declare const TAG_WIDTH = 10; export declare const PREFIX_WIDTH = 23; export type LogLevelName = "debug" | "info" | "warn" | "error"; export declare const LEVEL_GLYPHS: Record; export declare const ANSI: { readonly reset: "\u001B[0m"; readonly dim: "\u001B[2m"; readonly gray: "\u001B[90m"; readonly red: "\u001B[31m"; readonly green: "\u001B[32m"; readonly yellow: "\u001B[33m"; readonly blue: "\u001B[34m"; readonly magenta: "\u001B[35m"; readonly cyan: "\u001B[36m"; }; export declare const LEVEL_COLORS: Record; /** * Neutralize terminal control sequences and line-breaking control characters * in untrusted log text before framework-owned ANSI styling is applied. */ export declare function sanitizeLogText(value: string): string; /** * Pad or truncate a tag to fixed width for aligned output. */ export declare function padTag(tag: string): string; /** * Format a timestamp as HH:MM:SS. */ export declare function formatTimestamp(date?: Date): string; /** * Apply ANSI color codes to text if enabled. */ export declare function colorize(text: string, color: string | undefined, enable: boolean): string; /** * Normalize whitespace in text (collapse multiple spaces to single space). */ export declare function normalizeText(value: string): string; /** * Truncate text to maxLength, adding ellipsis if truncated. */ export declare function truncateText(value: string, maxLength?: number): string; /** * Format a value for log output (handles strings, numbers, booleans, objects). */ export declare function formatValue(value: unknown): string; /** * Serialized error structure for structured logging. */ export interface SerializedError { name: string; message: string; stack?: string; } /** * Format a serialized error for text output. */ export declare function formatErrorText(error: SerializedError | undefined): string; /** * Serialize an error object for structured logging. */ export declare function serializeError(error: unknown): SerializedError | undefined; /** * Format context and error as indented key=value pairs. * Filters out undefined values for cleaner output. */ export declare function formatContextText(context: Record, error: SerializedError | undefined, enableColor: boolean): string; /** * Check if value is a non-null, non-array object (plain record). */ export declare function isRecord(value: unknown): value is Record; //# sourceMappingURL=core.d.ts.map