import { Logger, LoggerService, OnModuleInit } from '@nestjs/common'; import type { EmailLogTransportService } from './email-log-transport.service'; import type { EmailLogOptions } from '../interfaces'; /** * Enhanced Logger service with email alert support * This service wraps the standard NestJS Logger and adds email alert functionality * for error and fatal level logs. * * @example * ```typescript * import { EmailLogLogger } from '@nest-omni/core'; * * @Injectable() * export class MyService { * private readonly logger = new EmailLogLogger(MyService.name); * * handleError() { * this.logger.error('Something went wrong!', error.stack); * // This will both log to console and send an email alert * } * } * ``` */ export declare class EmailLogLogger extends Logger implements LoggerService, OnModuleInit { private emailTransportService?; private emailTransport?; private emailOptions?; private minLevel; constructor(context?: string, emailTransportService?: EmailLogTransportService); /** * Initialize with email transport from DI */ onModuleInit(): Promise; /** * Set email transport manually (alternative to DI) */ setEmailTransport(transport: EmailLogTransportService, options: EmailLogOptions): void; /** * Log message */ log(message: any, context?: string): void; /** * Log error message */ error(message: any, stack?: string, context?: string): void; /** * Log warn message */ warn(message: any, context?: string): void; /** * Log debug message */ debug(message: any, context?: string): void; /** * Log verbose message */ verbose(message: any, context?: string): void; /** * Log fatal error message */ fatal(message: any, stack?: string, context?: string): void; /** * Send email alert if needed based on log level */ private sendEmailIfNeeded; /** * Check if email should be sent for the given log level */ private shouldSendEmail; } /** * Factory function to create an EmailLogLogger with email transport * Use this in your services to get a logger with email alert support * * @example * ```typescript * import { createEmailLogger } from '@nest-omni/core'; * * @Injectable() * export class MyService { * private readonly logger = createEmailLogger(MyService.name); * } * ``` */ export declare function createEmailLogger(context: string, emailTransport?: EmailLogTransportService, options?: EmailLogOptions): EmailLogLogger;