@sixbell-telco/sdk
Version:
A collection of reusable components designed for use in Sixbell Telco Angular projects
1 lines • 39.5 kB
Source Map (JSON)
{"version":3,"file":"sixbell-telco-sdk-utils-logger.mjs","sources":["../../../projects/sdk/utils/logger/src/constants.ts","../../../projects/sdk/utils/logger/src/logger.service.ts","../../../projects/sdk/utils/logger/src/providers/logger.provider.ts","../../../projects/sdk/utils/logger/sixbell-telco-sdk-utils-logger.ts"],"sourcesContent":["/**\n * Logger Constants\n * Color schemes, log levels, and configuration defaults\n */\n\nimport type { LogLevel } from './models/logger';\n\nexport const LOG_LEVELS: Record<LogLevel, number> = {\n\ttrace: 0,\n\tdebug: 1,\n\tinfo: 2,\n\twarn: 3,\n\terror: 4,\n\tfatal: 5,\n} as const;\n\n// Light mode colors\nexport const LOG_COLORS_LIGHT: Record<LogLevel, string> = {\n\ttrace: 'color: #666666; font-weight: bold;', // Dark Gray\n\tdebug: 'color: #0052a3; font-weight: bold;', // Dark Blue\n\tinfo: 'color: #006600; font-weight: bold;', // Dark Green\n\twarn: 'color: #cc7700; font-weight: bold;', // Dark Orange\n\terror: 'color: #cc0000; font-weight: bold;', // Dark Red\n\tfatal: 'color: #ffffff; background-color: #cc0000; font-weight: bold; padding: 2px 4px;', // White on Red\n} as const;\n\n// Dark mode colors\nexport const LOG_COLORS_DARK: Record<LogLevel, string> = {\n\ttrace: 'color: #aaaaaa; font-weight: bold;', // Light Gray\n\tdebug: 'color: #66b3ff; font-weight: bold;', // Light Blue\n\tinfo: 'color: #66ff66; font-weight: bold;', // Light Green\n\twarn: 'color: #ffcc66; font-weight: bold;', // Light Orange\n\terror: 'color: #ff6666; font-weight: bold;', // Light Red\n\tfatal: 'color: #ffffff; background-color: #ff4444; font-weight: bold; padding: 2px 4px;', // White on Light Red\n} as const;\n\n// Component/context color - Light mode (dark purple) / Dark mode (light purple)\nexport const CONTEXT_COLOR_LIGHT = 'color: #5500aa; font-weight: bold;' as const; // Dark Purple\nexport const CONTEXT_COLOR_DARK = 'color: #dd99ff; font-weight: bold;' as const; // Light Purple\n\n// Timestamp color - Light mode (dark teal) / Dark mode (light teal)\nexport const TIMESTAMP_COLOR_LIGHT = 'color: #006666; font-weight: bold;' as const; // Dark Teal\nexport const TIMESTAMP_COLOR_DARK = 'color: #66ffff; font-weight: bold;' as const; // Light Teal\n\n// IndexedDB defaults\nexport const IDB_STORE_NAME = 'sixbell-logs' as const;\nexport const IDB_DB_NAME = 'sixbell-ui-kit' as const;\nexport const MAX_STORED_LOGS = 1000 as const; // Prevent memory bloat\n","import { Injectable } from '@angular/core';\nimport {\n\tCONTEXT_COLOR_DARK,\n\tCONTEXT_COLOR_LIGHT,\n\tIDB_DB_NAME,\n\tIDB_STORE_NAME,\n\tLOG_COLORS_DARK,\n\tLOG_COLORS_LIGHT,\n\tLOG_LEVELS,\n\tMAX_STORED_LOGS,\n\tTIMESTAMP_COLOR_DARK,\n\tTIMESTAMP_COLOR_LIGHT,\n} from './constants';\nimport type { LoggerConfig, LoggerContext, LogLevel } from './models/logger';\n\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class LoggerService {\n\tprivate config: LoggerConfig = {\n\t\tenableLogging: false,\n\t\tlogLevel: 'error',\n\t\tshowTimestamp: false,\n\t\tshowDate: false,\n\t\tsilentMode: false,\n\t\tpersistToIndexedDB: false,\n\t\tidbRetentionDays: 7, // Default: keep logs for 7 days\n\t\tidbMaxLogs: 5000, // Default: store max 5000 logs in IndexedDB\n\t\tisDarkMode: false,\n\t};\n\n\tprivate logStore: Array<{\n\t\ttimestamp: number;\n\t\tlevel: LogLevel;\n\t\tmessage: string;\n\t\tcontext?: LoggerContext;\n\t\terror?: Error;\n\t}> = [];\n\n\tprivate darkModeMediaQuery: MediaQueryList | null = null;\n\tprivate darkModeListenerInitialized = false;\n\tprivate idbReady: Promise<IDBDatabase | null> = Promise.resolve(null);\n\n\t/**\n\t * Initialize automatic dark mode detection based on system preferences\n\t * Only called when logging is enabled to minimize performance impact\n\t */\n\tprivate initializeDarkModeDetection(): void {\n\t\t// Skip if already initialized or not needed\n\t\tif (this.darkModeListenerInitialized || this.config.silentMode) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof window !== 'undefined' && window.matchMedia) {\n\t\t\tthis.darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n\n\t\t\t// Set initial value based on system preference\n\t\t\tthis.config.isDarkMode = this.darkModeMediaQuery.matches;\n\n\t\t\t// Listen for changes in system preference with both addEventListener and addListener for better browser support\n\t\t\tconst handleChange = (e: MediaQueryListEvent | MediaQueryList) => {\n\t\t\t\tconst isDark = 'matches' in e ? e.matches : false;\n\t\t\t\tthis.config.isDarkMode = isDark;\n\n\t\t\t\t// Log the theme change for debugging\n\t\t\t\tif (this.config.enableLogging) {\n\t\t\t\t\tconsole.log(`%c[THEME CHANGED] Theme switched to ${isDark ? 'dark' : 'light'} mode`, isDark ? LOG_COLORS_DARK.info : LOG_COLORS_LIGHT.info);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.darkModeMediaQuery.addEventListener('change', handleChange as EventListener);\n\t\t\t// Fallback for older browsers\n\t\t\tif ((this.darkModeMediaQuery as unknown as { addListener?: (listener: (e: MediaQueryListEvent) => void) => void }).addListener) {\n\t\t\t\t(this.darkModeMediaQuery as unknown as { addListener: (listener: (e: MediaQueryListEvent) => void) => void }).addListener(\n\t\t\t\t\thandleChange as (e: MediaQueryListEvent) => void,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.darkModeListenerInitialized = true;\n\t\t}\n\t}\n\n\tconfigure(config: Partial<LoggerConfig>): void {\n\t\tthis.config = { ...this.config, ...config };\n\n\t\t// Only initialize dark mode detection when logging is enabled and not in silent mode\n\t\tif (this.config.enableLogging && !this.config.silentMode) {\n\t\t\tthis.initializeDarkModeDetection();\n\t\t}\n\n\t\t// Initialize IndexedDB if persistence is enabled\n\t\tif (this.config.persistToIndexedDB) {\n\t\t\tthis.idbReady = this.initializeIndexedDB();\n\t\t}\n\t}\n\n\t/**\n\t * Get all stored logs (useful for sending to external services)\n\t */\n\tgetStoredLogs() {\n\t\treturn [...this.logStore];\n\t}\n\n\t/**\n\t * Clear stored logs\n\t */\n\tclearStoredLogs() {\n\t\tthis.logStore = [];\n\t}\n\n\t/**\n\t * Initialize IndexedDB for persistent log storage\n\t * Only called when persistToIndexedDB is enabled\n\t */\n\tprivate initializeIndexedDB(): Promise<IDBDatabase | null> {\n\t\tif (!this.config.persistToIndexedDB || typeof indexedDB === 'undefined') {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst request = indexedDB.open(IDB_DB_NAME, 1);\n\n\t\t\trequest.onerror = () => {\n\t\t\t\tconsole.error('IndexedDB open error:', request.error);\n\t\t\t\tresolve(null);\n\t\t\t};\n\n\t\t\trequest.onsuccess = () => {\n\t\t\t\tresolve(request.result);\n\t\t\t};\n\n\t\t\trequest.onupgradeneeded = (event) => {\n\t\t\t\tconst db = (event.target as IDBOpenDBRequest).result;\n\t\t\t\tif (!db.objectStoreNames.contains(IDB_STORE_NAME)) {\n\t\t\t\t\tconst store = db.createObjectStore(IDB_STORE_NAME, { keyPath: 'id', autoIncrement: true });\n\t\t\t\t\tstore.createIndex('timestamp', 'timestamp', { unique: false });\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\n\t/**\n\t * Persist a log entry to IndexedDB\n\t */\n\tprivate persistLogToIndexedDB(logEntry: { timestamp: number; level: LogLevel; message: string; context?: LoggerContext; error?: Error }): void {\n\t\tif (!this.config.persistToIndexedDB) return;\n\n\t\tthis.idbReady.then((db) => {\n\t\t\tif (!db) return;\n\n\t\t\ttry {\n\t\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readwrite');\n\t\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\n\t\t\t\t// Don't persist Error objects directly (they don't serialize well)\n\t\t\t\tconst sanitizedEntry = {\n\t\t\t\t\t...logEntry,\n\t\t\t\t\terror: logEntry.error\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tname: logEntry.error.name,\n\t\t\t\t\t\t\t\tmessage: logEntry.error.message,\n\t\t\t\t\t\t\t\tstack: logEntry.error.stack,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\t};\n\n\t\t\t\tstore.add(sanitizedEntry);\n\n\t\t\t\t// Clean up old logs based on retention policy\n\t\t\t\tthis.cleanupOldLogs(db);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error persisting log to IndexedDB:', error);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Clean up old logs based on retention policy (days and max count)\n\t */\n\tprivate cleanupOldLogs(db: IDBDatabase): void {\n\t\ttry {\n\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readwrite');\n\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\t\t\tconst index = store.index('timestamp');\n\n\t\t\t// Calculate cutoff time (now - retention days)\n\t\t\tconst retentionMs = (this.config.idbRetentionDays || 7) * 24 * 60 * 60 * 1000;\n\t\t\tconst cutoffTime = Date.now() - retentionMs;\n\n\t\t\t// Delete logs older than retention period\n\t\t\tconst range = IDBKeyRange.upperBound(cutoffTime, true);\n\t\t\tconst cursorRequest = index.openCursor(range);\n\t\t\tcursorRequest.onsuccess = (event: Event) => {\n\t\t\t\tconst target = event.target as IDBRequest<IDBCursorWithValue | null>;\n\t\t\t\tconst cursor = target.result;\n\t\t\t\tif (cursor) {\n\t\t\t\t\tcursor.delete();\n\t\t\t\t\tcursor.continue();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Also check max log count and delete oldest if exceeded\n\t\t\tconst getAllRequest = store.getAll();\n\t\t\tgetAllRequest.onsuccess = () => {\n\t\t\t\tconst allLogs = getAllRequest.result as Array<{ id: number; timestamp: number }>;\n\t\t\t\tconst maxLogs = this.config.idbMaxLogs || 5000;\n\n\t\t\t\tif (allLogs.length > maxLogs) {\n\t\t\t\t\t// Sort by timestamp and delete oldest ones\n\t\t\t\t\tallLogs.sort((a, b) => a.timestamp - b.timestamp);\n\t\t\t\t\tconst logsToDelete = allLogs.slice(0, allLogs.length - maxLogs);\n\n\t\t\t\t\tlogsToDelete.forEach((log: { id: number }) => {\n\t\t\t\t\t\tstore.delete(log.id);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconsole.error('Error cleaning up old logs:', error);\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve logs from IndexedDB\n\t */\n\tasync getPersistedLogs(): Promise<\n\t\tArray<{\n\t\t\tid?: number;\n\t\t\ttimestamp: number;\n\t\t\tlevel: LogLevel;\n\t\t\tmessage: string;\n\t\t\tcontext?: LoggerContext;\n\t\t\terror?: { name: string; message: string; stack?: string };\n\t\t}>\n\t> {\n\t\tconst db = await this.idbReady;\n\t\tif (!db) return [];\n\n\t\treturn new Promise((resolve) => {\n\t\t\ttry {\n\t\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readonly');\n\t\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\t\t\t\tconst request = store.getAll();\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tresolve(request.result);\n\t\t\t\t};\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tconsole.error('Error retrieving logs from IndexedDB:', request.error);\n\t\t\t\t\tresolve([]);\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error reading IndexedDB:', error);\n\t\t\t\tresolve([]);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Clear persisted logs from IndexedDB\n\t */\n\tasync clearPersistedLogs(): Promise<void> {\n\t\tconst db = await this.idbReady;\n\t\tif (!db) return;\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readwrite');\n\t\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\t\t\t\tconst request = store.clear();\n\n\t\t\t\trequest.onsuccess = () => resolve();\n\t\t\t\trequest.onerror = () => reject(request.error);\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Download logs as a JSON file\n\t * Combines in-memory logs with persisted IndexedDB logs\n\t */\n\tasync downloadLogs(filename: string = `logs-${Date.now()}.json`): Promise<void> {\n\t\ttry {\n\t\t\t// Get all logs (memory + IndexedDB)\n\t\t\tconst memoryLogs = this.getStoredLogs();\n\t\t\tconst persistedLogs = await this.getPersistedLogs();\n\t\t\tconst allLogs = [...memoryLogs, ...persistedLogs];\n\n\t\t\t// Create JSON blob\n\t\t\tconst jsonStr = JSON.stringify(allLogs, null, 2);\n\t\t\tconst blob = new Blob([jsonStr], { type: 'application/json' });\n\n\t\t\t// Create download link and trigger\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\tconst link = document.createElement('a');\n\t\t\tlink.href = url;\n\t\t\tlink.download = filename;\n\t\t\tdocument.body.appendChild(link);\n\t\t\tlink.click();\n\t\t\tdocument.body.removeChild(link);\n\t\t\tURL.revokeObjectURL(url);\n\t\t} catch (error) {\n\t\t\tconsole.error('Error downloading logs:', error);\n\t\t}\n\t}\n\n\t/**\n\t * Update theme mode for color adjustment\n\t * If you want to restore automatic detection, pass undefined\n\t *\n\t * @param isDark true for dark mode, false for light mode, undefined to use system preference\n\t */\n\tsetDarkMode(isDark: boolean | undefined): void {\n\t\tif (isDark === undefined) {\n\t\t\t// Restore automatic detection - initialize listener if needed\n\t\t\tif (this.config.enableLogging && !this.config.silentMode) {\n\t\t\t\tthis.initializeDarkModeDetection();\n\t\t\t}\n\t\t\tif (this.darkModeMediaQuery) {\n\t\t\t\tthis.config.isDarkMode = this.darkModeMediaQuery.matches;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.config.isDarkMode = isDark;\n\t\t}\n\t}\n\n\t/**\n\t * Get current dark mode status\n\t */\n\tisDarkMode(): boolean {\n\t\treturn this.config.isDarkMode || false;\n\t}\n\n\t/**\n\t * Create a temporary logger with override configuration.\n\t * Useful for local use-case-specific logging without global provider changes.\n\t *\n\t * @param overrideConfig Configuration that overrides current logger settings\n\t * @returns A new LoggerService instance with merged config\n\t *\n\t * @example\n\t * ```typescript\n\t * // In theme service:\n\t * private readonly logger = inject(LoggerService);\n\t *\n\t * // For this specific operation, use debug level:\n\t * const debugLogger = this.logger.withConfig({ logLevel: 'debug' });\n\t * debugLogger.debug('Detailed operation trace');\n\t *\n\t * // Back to global config:\n\t * this.logger.debug('This respects global config');\n\t * ```\n\t */\n\twithConfig(overrideConfig: Partial<LoggerConfig>): LoggerService {\n\t\tconst logger = new LoggerService();\n\t\tlogger.configure({ ...this.config, ...overrideConfig });\n\t\treturn logger;\n\t}\n\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\tif (!this.config.enableLogging) return false;\n\n\t\tconst currentLevel = LOG_LEVELS[this.config.logLevel || 'error'];\n\t\tconst messageLevel = LOG_LEVELS[level];\n\n\t\treturn messageLevel >= currentLevel;\n\t}\n\n\tprivate getColors(): Record<LogLevel, string> {\n\t\treturn this.config.isDarkMode ? LOG_COLORS_DARK : LOG_COLORS_LIGHT;\n\t}\n\n\tprivate getContextColor(): string {\n\t\treturn this.config.isDarkMode ? CONTEXT_COLOR_DARK : CONTEXT_COLOR_LIGHT;\n\t}\n\n\tprivate getTimestampColor(): string {\n\t\treturn this.config.isDarkMode ? TIMESTAMP_COLOR_DARK : TIMESTAMP_COLOR_LIGHT;\n\t}\n\n\tprivate storeLog(level: LogLevel, message: string, context?: LoggerContext, error?: Error): void {\n\t\tthis.logStore.push({\n\t\t\ttimestamp: Date.now(),\n\t\t\tlevel,\n\t\t\tmessage,\n\t\t\tcontext,\n\t\t\terror,\n\t\t});\n\n\t\t// Prevent memory bloat\n\t\tif (this.logStore.length > MAX_STORED_LOGS) {\n\t\t\tthis.logStore.shift();\n\t\t}\n\t}\n\n\t/**\n\t * Extract component name from message pattern like \"[ComponentName] message\"\n\t * and return formatted parts for colored logging\n\t */\n\tprivate formatMessageWithContext(message: string): { formatted: string; styles: string[] } {\n\t\tconst componentMatch = message.match(/^\\[([^\\]]+)\\]\\s(.*)$/);\n\t\tconst contextColor = this.getContextColor();\n\n\t\tif (componentMatch) {\n\t\t\tconst componentName = componentMatch[1];\n\t\t\tconst restOfMessage = componentMatch[2];\n\t\t\treturn {\n\t\t\t\tformatted: `%c[${componentName}]%c ${restOfMessage}`,\n\t\t\t\tstyles: [contextColor, ''],\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tformatted: `%c${message}`,\n\t\t\tstyles: [''],\n\t\t};\n\t}\n\n\t/**\n\t * Format complete log output with level, timestamp, context, and message\n\t * Returns array of format string and all styles for console output\n\t */\n\tprivate formatCompleteLogOutput(level: LogLevel, message: string, context?: LoggerContext): { format: string; styles: string[] } {\n\t\tconst colors = this.getColors();\n\t\tconst levelStyle = colors[level];\n\t\tconst contextColor = this.getContextColor();\n\t\tconst timestampColor = this.getTimestampColor();\n\n\t\tlet format = `%c[${level.toUpperCase()}]`;\n\t\tconst styles: string[] = [levelStyle];\n\n\t\t// Add timestamp if enabled\n\t\tif (this.config.showTimestamp || this.config.showDate) {\n\t\t\tconst now = new Date();\n\t\t\tconst isoString = now.toISOString();\n\t\t\tlet timeStr: string;\n\n\t\t\tif (this.config.showDate) {\n\t\t\t\tconst date = isoString.split('T')[0];\n\t\t\t\tconst time = isoString.split('T')[1].slice(0, 12);\n\t\t\t\ttimeStr = `${date} ${time}`;\n\t\t\t} else {\n\t\t\t\ttimeStr = isoString.split('T')[1].slice(0, 12);\n\t\t\t}\n\n\t\t\tformat += `%c [${timeStr}]`;\n\t\t\tstyles.push(timestampColor);\n\t\t}\n\n\t\t// Add context if provided\n\t\tif (context?.component) {\n\t\t\tformat += `%c [${context.component}]`;\n\t\t\tstyles.push(contextColor);\n\t\t}\n\n\t\t// Add message\n\t\tformat += `%c ${message}`;\n\t\tstyles.push('');\n\n\t\treturn { format, styles };\n\t}\n\n\ttrace(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('trace')) {\n\t\t\tconst logEntry = { level: 'trace' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('trace', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('trace', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.debug(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.debug(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t}\n\n\tdebug(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('debug')) {\n\t\t\tconst logEntry = { level: 'debug' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('debug', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('debug', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.debug(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.debug(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t}\n\n\tinfo(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('info')) {\n\t\t\tconst logEntry = { level: 'info' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('info', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('info', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.info(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.info(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t}\n\n\twarn(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('warn')) {\n\t\t\tconst logEntry = { level: 'warn' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('warn', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('warn', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.warn(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t\tthis.reportToExternal('warn', message, context);\n\t}\n\n\terror(message: string, error?: Error, context?: LoggerContext): void {\n\t\tif (this.shouldLog('error')) {\n\t\t\tconst logEntry = { level: 'error' as LogLevel, message, context, timestamp: Date.now(), error };\n\t\t\tthis.storeLog('error', message, context, error);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('error', message, context);\n\n\t\t\t\tif (error && context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, error, context);\n\t\t\t\t} else if (error) {\n\t\t\t\t\tconsole.error(format, ...styles, error);\n\t\t\t\t} else if (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t\tthis.reportToExternal('error', message, context, error);\n\t}\n\n\tfatal(message: string, error?: Error, context?: LoggerContext): void {\n\t\tif (this.shouldLog('fatal')) {\n\t\t\tconst logEntry = { level: 'fatal' as LogLevel, message, context, timestamp: Date.now(), error };\n\t\t\tthis.storeLog('fatal', message, context, error);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('fatal', message, context);\n\n\t\t\t\tif (error && context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, error, context);\n\t\t\t\t} else if (error) {\n\t\t\t\t\tconsole.error(format, ...styles, error);\n\t\t\t\t} else if (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t\tthis.reportToExternal('fatal', message, context, error);\n\t}\n\n\tprivate reportToExternal(level: string, message: string, context?: LoggerContext, error?: Error): void {\n\t\t// Only report warn, error, and fatal to external services\n\t\tif (this.config.onError && error) {\n\t\t\tthis.config.onError(error, context || this.createContext('unknown'));\n\t\t}\n\n\t\tif (this.config.errorReporter && error) {\n\t\t\tthis.config.errorReporter.captureException(error, context);\n\t\t}\n\t}\n\n\tprivate createContext(component: string): LoggerContext {\n\t\treturn {\n\t\t\tcomponent,\n\t\t\taction: 'unknown',\n\t\t\ttimestamp: Date.now(),\n\t\t};\n\t}\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { LoggerService } from '../logger.service';\nimport type { LoggerConfig } from '../models/logger';\n\nexport function provideLogger(config?: Partial<LoggerConfig>): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: LoggerService,\n\t\t\tuseFactory: () => {\n\t\t\t\tconst logger = new LoggerService();\n\t\t\t\tlogger.configure(config || {});\n\t\t\t\treturn logger;\n\t\t\t},\n\t\t},\n\t]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;AAGG;AAII,MAAM,UAAU,GAA6B;AACnD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,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