import { LoggerService, NAuthLoggerConfig } from '../interfaces/config.interface'; /** * NAuth Logger Wrapper * * Wraps any NestJS-compatible logger and adds features: * 1. "NAUTH:" prefix to all messages for easy identification * 2. Automatic PII redaction (emails, IPs, tokens, etc.) - enabled by default * 3. Optional log level filtering * 4. Silent mode if no logger is provided * * This allows nauth-toolkit to integrate seamlessly with the consuming application's * logging infrastructure while maintaining security and compliance. * * @example * ```typescript * // With NestJS built-in logger (PII redaction enabled by default) * const logger = new NAuthLogger(new Logger('MyApp')); * logger.log('User user@example.com signed up'); * // Output: [MyApp] NAUTH: User u***@***.com signed up * * // With config options * const logger = new NAuthLogger({ * instance: new Logger('MyApp'), * enablePiiRedaction: true, // Default * logLevel: 'debug' * }); * * // Disable PII redaction (debugging only) * const logger = new NAuthLogger({ * instance: myLogger, * enablePiiRedaction: false * }); * * // Silent mode (no logger provided) * const logger = new NAuthLogger(); * logger.log('This will not be logged'); // No output * ``` */ export declare class NAuthLogger implements LoggerService { private static readonly PREFIX; private readonly logger?; private readonly piiRedactor; private readonly enablePiiRedaction; private readonly logLevel?; constructor(config?: LoggerService | NAuthLoggerConfig); /** * Log a message (info level) */ log(message: any, ...optionalParams: any[]): any; /** * Log an error message */ error(message: any, ...optionalParams: any[]): any; /** * Log a warning message */ warn(message: any, ...optionalParams: any[]): any; /** * Log a debug message */ debug(message: any, ...optionalParams: any[]): any; /** * Log a verbose message */ verbose(message: any, ...optionalParams: any[]): any; /** * Process message: add prefix and apply PII redaction * @private */ private processMessage; /** * Process optional parameters: apply PII redaction * @private */ private processParams; /** * Check if message should be logged based on log level * @private */ private shouldLog; /** * Check if logger is enabled */ isEnabled(): boolean; /** * Check if PII redaction is enabled */ isPiiRedactionEnabled(): boolean; } //# sourceMappingURL=nauth-logger.d.ts.map