import { LogsInterceptorConfig } from './application/config/LogsInterceptorConfig'; export interface EnvironmentConfig { LOGS_TRANSPORT?: string; LOGS_URL?: string; LOGS_TENANT?: string; LOGS_TOKEN?: string; LOGS_APP_NAME?: string; LOGS_APP_VERSION?: string; LOGS_ENVIRONMENT?: string; LOGS_COMPRESSION?: string; LOGS_COMPRESSION_LEVEL?: string; LOGS_COMPRESSION_THRESHOLD?: string; LOGS_USE_WORKERS?: string; LOGS_MAX_WORKERS?: string; LOGS_CONNECTION_POOLING?: string; LOGS_MAX_SOCKETS?: string; LOGS_TIMEOUT?: string; LOGS_MAX_RETRIES?: string; LOGS_RETRY_DELAY?: string; LOGS_BUFFER_MAX_SIZE?: string; LOGS_BUFFER_FLUSH_INTERVAL?: string; LOGS_BUFFER_MAX_MEMORY_MB?: string; LOGS_BUFFER_MAX_AGE?: string; LOGS_BUFFER_AUTO_FLUSH?: string; LOGS_FILTER_LEVELS?: string; LOGS_FILTER_SAMPLING_RATE?: string; LOGS_FILTER_SANITIZE?: string; LOGS_FILTER_MAX_MESSAGE_LENGTH?: string; LOGS_FILTER_MAX_CONTEXT_BYTES?: string; LOGS_CIRCUIT_BREAKER_ENABLED?: string; LOGS_CIRCUIT_BREAKER_FAILURE_THRESHOLD?: string; LOGS_CIRCUIT_BREAKER_RESET_TIMEOUT?: string; LOGS_CIRCUIT_BREAKER_HALF_OPEN_REQUESTS?: string; LOGS_DLQ_ENABLED?: string; LOGS_DLQ_TYPE?: string; LOGS_DLQ_MAX_SIZE?: string; LOGS_DLQ_MAX_RETRIES?: string; LOGS_DLQ_BASE_PATH?: string; LOGS_MAX_CONCURRENT_FLUSHES?: string; LOGS_MAX_PENDING_BATCHES?: string; LOGS_WORKER_TIMEOUT?: string; LOGS_INTERCEPT_CONSOLE?: string; LOGS_PRESERVE_ORIGINAL_CONSOLE?: string; LOGS_ENABLE_METRICS?: string; LOGS_ENABLE_HEALTH_CHECK?: string; LOGS_DEBUG?: string; LOGS_SILENT_ERRORS?: string; LOGS_AUTO_INIT?: string; LOGS_ENABLED?: string; OTEL_LOGS_EXPORTER?: string; OTEL_EXPORTER_OTLP_ENDPOINT?: string; OTEL_EXPORTER_OTLP_HEADERS?: string; OTEL_EXPORTER_OTLP_LOGS_ENDPOINT?: string; OTEL_EXPORTER_OTLP_LOGS_HEADERS?: string; [key: string]: string | undefined; } export interface TransportOptions { type?: 'loki' | 'otlp'; url: string; logsUrl?: string; tenantId?: string; authToken?: string; headers?: Record; timeout?: number; maxRetries?: number; retryDelay?: number; compression?: 'none' | 'gzip' | 'brotli' | 'snappy' | boolean; } export declare function parseBool(value: string | undefined, defaultValue: boolean): boolean; export declare function parseIntRange(value: string | undefined, defaultValue: number, min: number, max: number): number; export declare function parseFloatRange(value: string | undefined, defaultValue: number, min: number, max: number): number; export declare function isDebugEnabled(): boolean; export declare function isSilentErrorsEnabled(): boolean; export declare function internalDebug(message: string, context?: unknown): void; export declare function internalWarn(message: string, context?: unknown): void; export declare function internalError(message: string, context?: unknown): void; /** * Safely stringify any value, handling circular references and non-serializable objects */ export declare function safeStringify(value: unknown, maxDepth?: number, maxBytes?: number): string; /** * Detect sensitive data in a string */ export declare function detectSensitiveData(text: string, patterns: RegExp[]): boolean; /** * Sanitize sensitive data from an object */ export declare function sanitizeData(data: Record, sensitivePatterns: RegExp[]): Record; /** * Hash sensitive data for tracking without exposing it */ export declare function hashSensitiveData(data: string): string; /** * Parse labels from environment variable string format * Format: "key1=value1,key2=value2" */ export declare function parseLabels(labelsString: string): Record; /** * Determine if a log should be sampled based on sampling rate */ export declare function shouldSample(rate: number): boolean; /** * Enhanced sampling with support for different strategies */ export declare function shouldSampleAdvanced(rate: number, strategy?: 'random' | 'deterministic' | 'adaptive', key?: string): boolean; /** * Format bytes to human readable string */ export declare function formatBytes(bytes: number): string; /** * Calculate compression ratio */ export declare function calculateCompressionRatio(original: number, compressed: number): number; /** * Load configuration from environment variables */ export declare function loadConfigFromEnv(env?: EnvironmentConfig): Partial; /** * Merge configurations with precedence: user config > env config > defaults */ export declare function mergeConfigs(userConfig: Partial, envConfig: Partial): Partial; /** * Create a correlation ID for request tracking */ export declare function createCorrelationId(): string; /** * Extract metadata from Error objects */ export declare function extractErrorMetadata(error: Error): Record; /** * Parse stack trace to extract useful information */ export declare function parseStackTrace(stack: string): Array<{ function: string; file: string; line: number; column: number; }>; //# sourceMappingURL=utils.d.ts.map