47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
/**
|
|
* SMTP Client Logging Utilities
|
|
* Client-side logging utilities for SMTP operations
|
|
*/
|
|
import type { ISmtpResponse, ISmtpClientOptions } from '../interfaces.js';
|
|
export interface ISmtpClientLogData {
|
|
component: string;
|
|
host?: string;
|
|
port?: number;
|
|
secure?: boolean;
|
|
command?: string;
|
|
response?: ISmtpResponse;
|
|
error?: Error;
|
|
connectionId?: string;
|
|
messageId?: string;
|
|
duration?: number;
|
|
[key: string]: any;
|
|
}
|
|
/**
|
|
* Log SMTP client connection events
|
|
*/
|
|
export declare function logConnection(event: 'connecting' | 'connected' | 'disconnected' | 'error', options: ISmtpClientOptions, data?: Partial<ISmtpClientLogData>): void;
|
|
/**
|
|
* Log SMTP command execution
|
|
*/
|
|
export declare function logCommand(command: string, response?: ISmtpResponse, options?: ISmtpClientOptions, data?: Partial<ISmtpClientLogData>): void;
|
|
/**
|
|
* Log authentication events
|
|
*/
|
|
export declare function logAuthentication(event: 'start' | 'success' | 'failure', method: string, options: ISmtpClientOptions, data?: Partial<ISmtpClientLogData>): void;
|
|
/**
|
|
* Log TLS/STARTTLS events
|
|
*/
|
|
export declare function logTLS(event: 'starttls_start' | 'starttls_success' | 'starttls_failure' | 'tls_connected', options: ISmtpClientOptions, data?: Partial<ISmtpClientLogData>): void;
|
|
/**
|
|
* Log email sending events
|
|
*/
|
|
export declare function logEmailSend(event: 'start' | 'success' | 'failure', recipients: string[], options: ISmtpClientOptions, data?: Partial<ISmtpClientLogData>): void;
|
|
/**
|
|
* Log performance metrics
|
|
*/
|
|
export declare function logPerformance(operation: string, duration: number, options: ISmtpClientOptions, data?: Partial<ISmtpClientLogData>): void;
|
|
/**
|
|
* Log debug information (only when debug is enabled)
|
|
*/
|
|
export declare function logDebug(message: string, options: ISmtpClientOptions, data?: Partial<ISmtpClientLogData>): void;
|