UNPKG

sfcoe-ailabs

Version:

AI-powered code review tool with static analysis integration for comprehensive code quality assessment.

97 lines (96 loc) 3.15 kB
import winston from 'winston'; import type { DatadogLoggerConfig } from '../../utils/index.js'; /** * Datadog Winston logger configuration and setup */ export declare class DatadogLogger { private static instance; private static config; /** * Initialize the Datadog logger with configuration * * @param config - The Datadog logger configuration object * @returns The initialized Winston logger instance */ static initialize(config: DatadogLoggerConfig): winston.Logger; /** * Get the configured logger instance * * @returns The Winston logger instance * @throws Error if logger is not initialized */ static getInstance(): winston.Logger; /** * Check if logger is initialized * * @returns True if the logger is initialized, false otherwise */ static isInitialized(): boolean; /** * Get current configuration * * @returns The current Datadog logger configuration or null if not set */ static getConfig(): DatadogLoggerConfig | null; /** * Log debug message * * @param message - The debug message to log * @param meta - Optional metadata object to include with the log */ static debug(message: string, meta?: Record<string, unknown>): void; /** * Log info message * * @param message - The info message to log * @param meta - Optional metadata object to include with the log */ static info(message: string, meta?: Record<string, unknown>): void; /** * Log warning message * * @param message - The warning message to log * @param meta - Optional metadata object to include with the log */ static warn(message: string, meta?: Record<string, unknown>): void; /** * Log error message * * @param message - The error message to log * @param error - Optional error object or metadata to include with the log */ static error(message: string, error?: Error | Record<string, unknown>): void; /** * Log with custom level * * @param level - The log level (e.g., 'info', 'debug', 'error') * @param message - The message to log * @param meta - Optional metadata object to include with the log */ static log(level: string, message: string, meta?: Record<string, unknown>): void; /** * Update custom metadata that will be included in all future logs * * @param meta - The metadata object to merge with existing custom metadata */ static updateCustomMeta(meta: Record<string, unknown>): void; /** * Set a specific metadata field * * @param key - The metadata field key * @param value - The value to set for the metadata field */ static setMetaField(key: string, value: unknown): void; /** * Remove a metadata field * * @param key - The metadata field key to remove */ static removeMetaField(key: string): void; /** * Get current custom metadata * * @returns The current custom metadata object */ static getCustomMeta(): Record<string, unknown>; }