/** * dlog.ts - Developer Logging Utility for Node.js/TypeScript Projects * * Provides a configurable, developer-friendly logging namespace with support for: * - Multiple log levels (debug, info, success, error, exception) * - Unicode icons for log levels * - Automatic caller function name detection * - Redaction of sensitive fields (e.g., keys, tokens) in objects * - Pretty-printing of objects and arrays * - Full stack trace logging for exceptions * - Configurable development mode and PII logging * * Usage: * import { dlog } from './dlog'; * dlog.setConfig({ isDev: true }); * dlog.d("Debug message", { some: "object" }); * dlog.e("Error message"); * dlog.ex(new Error("Something went wrong")); */ export declare namespace dlog { interface DlogConfig { isDev?: boolean; enablePII?: boolean; ignoreAllLogging?: boolean; } /** * Sets the logging configuration. * @param cfg Configuration object (e.g., { isDev: true, enablePII: false }) */ export function setConfig(cfg: DlogConfig): void; /** * Logs a debug message. */ export function d(msg: unknown, msg2?: unknown): void; /** * Logs an info message. */ export function i(msg: unknown, msg2?: unknown): void; /** * Logs a success message. */ export function s(msg: unknown, msg2?: unknown): void; /** * Logs an error message. */ export function e(msg: unknown, msg2?: unknown): void; /** * Logs an exception with callstack and unicode warning. * Prints the full stack trace. */ export function ex(error: Error, ignore?: boolean, msg?: string): void; /** * Returns the log history and clears it. */ export function getLogHistoryAndFlash(): string[]; export {}; }