interface LogContext { [key: string]: any; } /** * Backend interface for pluggable logger implementations. * Consumers can provide pino, winston, or any logger that satisfies this shape. */ export interface LoggerBackend { debug(message: string, context?: Record): void; info(message: string, context?: Record): void; warn(message: string, context?: Record): void; error(message: string, context?: Record): void; } /** * Factory that creates a LoggerBackend for a given context name. * Use this to integrate structured loggers like pino: * * @example * ```ts * import pino from 'pino'; * const root = pino(); * setLoggerBackend((context) => root.child({ context })); * ``` */ export type LoggerBackendFactory = (context: string) => LoggerBackend; /** * Set a custom logger backend factory. * All existing and future loggers created via createLogger() will use this backend. * Pass `null` to reset to the default console-based logger. */ export declare function setLoggerBackend(factory: LoggerBackendFactory | null): void; /** * Sanitization utilities for secure logging */ /** * Sanitize tokens by returning only a hash prefix * Prevents token exposure while maintaining debuggability */ export declare function sanitizeToken(token: string | undefined | null): string; /** * Sanitize email addresses * Shows first 2 chars of local part + domain */ export declare function sanitizeEmail(email: string | undefined | null): string; /** * Sanitize user IDs * Shows only first 8 characters with prefix */ export declare function sanitizeUserId(userId: string | undefined | null): string; /** * Sanitize objects by redacting sensitive fields * Automatically redacts fields containing: token, password, secret, key, authorization */ export declare function sanitizeObject(obj: any): any; declare class Logger { private context; constructor(context: string); private getBackend; private log; debug(message: string, data?: LogContext): void; info(message: string, data?: LogContext): void; warn(message: string, data?: LogContext): void; error(message: string, error?: Error | any, data?: LogContext): void; } export declare function createLogger(context: string): Logger; export declare const authLogger: Logger; export declare const apiLogger: Logger; export declare const dbLogger: Logger; export declare const chatLogger: Logger; export {}; //# sourceMappingURL=logger.d.ts.map