/** * Structured JSON logger * * Silent during tests unless DEBUG=true. * `debug` is opt-in everywhere, test or not: it only emits when DEBUG=true, * the same flag that unsilences tests, so a host enables high-volume * diagnostic logging (e.g. per-request content) with one env var rather than * a second one to learn. * Automatically redacts phone numbers (recursively, by key name, including * inside an array of raw phone strings) and previews every other string * field to a fixed length once it exceeds that length - a value at or under * the preview length logs in full, verbatim (see SECURITY.md). Set * TALKER_LOG_VERBOSE=true to log full, untruncated content instead of the * preview (phone redaction, and any field named in TALKER_LOG_REDACT_KEYS, * still apply). */ type LogLevel = "debug" | "info" | "warn" | "error"; /** * Whether a log at `level` actually emits, given the silence/debug policy. * Pure and exported so the "debug is suppressed outside DEBUG=true" case can * be tested directly: `isTestEnv()`'s argv half is fixed at module load (see * above), so under `bun test` it is always true, and `isSilent()` already * swallows every level whenever `DEBUG` isn't `"true"` - there is no way to * observe this function's non-test branch by spying on `console.log` from * within the suite. */ export declare function isLevelEnabled(level: LogLevel, opts: { silent: boolean; debugEnabled: boolean; }): boolean; /** * Redact a phone number, keeping only the last 4 digits. * E.g. "+15551234567" -> "***4567" */ export declare function redactPhone(phone: string): string; export declare const logger: { debug: (message: string, data?: Record) => void; info: (message: string, data?: Record) => void; warn: (message: string, data?: Record) => void; error: (message: string, data?: Record) => void; }; export {};