logan-logger 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +245 -0
- package/dist/__vite-browser-external-BcPniuRQ.js +2 -0
- package/dist/__vite-browser-external-BcPniuRQ.js.map +1 -0
- package/dist/__vite-browser-external-DYxpcVy9.mjs +5 -0
- package/dist/__vite-browser-external-DYxpcVy9.mjs.map +1 -0
- package/dist/index.d.ts +376 -0
- package/dist/index.esm.js +642 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/core/types.ts","../src/utils/runtime.ts","../src/utils/serialization.ts","../src/core/logger.ts","../src/runtime/node.ts","../src/runtime/browser.ts","../src/utils/config.ts","../src/core/factory.ts","../src/index.ts"],"sourcesContent":["/**\n * Log levels in ascending order of severity.\n * Used to filter which messages should be logged.\n */\nexport enum LogLevel {\n /** Debug messages - most verbose */\n DEBUG = 0,\n /** Informational messages */\n INFO = 1,\n /** Warning messages */\n WARN = 2,\n /** Error messages */\n ERROR = 3,\n /** No messages - silent mode */\n SILENT = 4\n}\n\n/**\n * String representation of log levels.\n */\nexport type LogLevelString = 'debug' | 'info' | 'warn' | 'error' | 'silent';\n\n/**\n * Supported JavaScript runtime environments.\n */\nexport type RuntimeName = 'node' | 'deno' | 'bun' | 'browser' | 'webworker' | 'unknown';\n\n/**\n * Information about the detected JavaScript runtime environment.\n */\nexport interface RuntimeInfo {\n /** The name of the runtime */\n name: RuntimeName;\n /** Version string of the runtime (if available) */\n version?: string;\n /** Capabilities supported by this runtime */\n capabilities: RuntimeCapabilities;\n}\n\n/**\n * Capabilities that a runtime may or may not support.\n */\nexport interface RuntimeCapabilities {\n /** Whether the runtime supports file system operations */\n fileSystem: boolean;\n /** Whether the runtime supports colored console output */\n colorSupport: boolean;\n /** Whether the runtime provides process information */\n processInfo: boolean;\n /** Whether the runtime supports streams */\n streams: boolean;\n}\n\n/**\n * Configuration options for creating a logger instance.\n */\nexport interface LoggerConfig {\n /** Minimum log level to output */\n level: LogLevel;\n /** Output format for log messages */\n format: 'json' | 'text' | 'custom';\n /** Whether to include timestamps in log output */\n timestamp: boolean;\n /** Whether to colorize log output (if supported) */\n colorize: boolean;\n /** Default metadata to include with all log messages */\n metadata: Record<string, any>;\n /** Transport configurations for log output */\n transports?: TransportConfig[];\n}\n\n/**\n * Configuration for a specific log transport (output destination).\n */\nexport interface TransportConfig {\n /** Type of transport */\n type: 'console' | 'file' | 'http' | 'custom';\n /** Minimum log level for this transport */\n level?: LogLevel;\n /** Transport-specific options */\n options: Record<string, any>;\n}\n\n/**\n * A log message can be a string or a function that returns a string.\n * Functions enable lazy evaluation for expensive log message generation.\n */\nexport type LogMessage = string | (() => string);\n\n/**\n * Internal representation of a log entry.\n */\nexport interface LogEntry {\n /** When the log entry was created */\n timestamp: Date;\n /** Log level of this entry */\n level: LogLevel;\n /** The log message */\n message: string;\n /** Additional structured data */\n metadata?: Record<string, any>;\n /** Runtime that generated this log entry */\n runtime: RuntimeName;\n}\n\n/**\n * Main logger interface providing methods for logging at different levels.\n * This interface is implemented by all logger implementations across different runtimes.\n */\nexport interface ILogger {\n /**\n * Log a debug message. Only shown when log level is DEBUG.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n debug(message: LogMessage, metadata?: any): void;\n \n /**\n * Log an informational message.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n info(message: LogMessage, metadata?: any): void;\n \n /**\n * Log a warning message.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n warn(message: LogMessage, metadata?: any): void;\n \n /**\n * Log an error message.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n error(message: LogMessage, metadata?: any): void;\n \n /**\n * Log a message at a specific level.\n * @param level - The log level\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n log(level: LogLevel, message: LogMessage, metadata?: any): void;\n \n /**\n * Set the minimum log level for this logger.\n * @param level - The minimum log level\n */\n setLevel(level: LogLevel): void;\n \n /**\n * Get the current minimum log level.\n * @returns The current log level\n */\n getLevel(): LogLevel;\n \n /**\n * Create a child logger with additional metadata.\n * @param metadata - Additional metadata to include in all child log messages\n * @returns A new logger instance with the additional metadata\n */\n child(metadata: Record<string, any>): ILogger;\n}\n\n/**\n * Interface for logger adapters that handle the actual log output.\n * This abstraction allows different implementations for different runtimes.\n */\nexport interface ILoggerAdapter {\n /**\n * Write a log entry to the output destination.\n * @param entry - The log entry to write\n */\n log(entry: LogEntry): void;\n \n /**\n * Set the minimum log level for this adapter.\n * @param level - The minimum log level\n */\n setLevel(level: LogLevel): void;\n \n /**\n * Get the current minimum log level.\n * @returns The current log level\n */\n getLevel(): LogLevel;\n}","import { RuntimeInfo, RuntimeName, RuntimeCapabilities } from '../core/types.ts';\n\n/**\n * Detects the current JavaScript runtime environment and its capabilities.\n * @returns Information about the detected runtime\n * @example\n * ```typescript\n * const runtime = detectRuntime();\n * console.log(`Running on: ${runtime.name} ${runtime.version}`);\n * ```\n */\nexport function detectRuntime(): RuntimeInfo {\n const name = detectRuntimeName();\n const version = getRuntimeVersion(name);\n const capabilities = getRuntimeCapabilities(name);\n\n return {\n name,\n version,\n capabilities\n };\n}\n\nfunction detectRuntimeName(): RuntimeName {\n // Check for Deno\n if (typeof (globalThis as any).Deno !== 'undefined') {\n return 'deno';\n }\n\n // Check for Bun\n if (typeof (globalThis as any).Bun !== 'undefined') {\n return 'bun';\n }\n\n // Check for browser environment\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n return 'browser';\n }\n\n // Check for Web Worker\n if (typeof (globalThis as any).importScripts === 'function' && typeof window === 'undefined') {\n return 'webworker';\n }\n\n // Check for Node.js\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n return 'node';\n }\n\n return 'unknown';\n}\n\nfunction getRuntimeVersion(runtime: RuntimeName): string | undefined {\n switch (runtime) {\n case 'node':\n return typeof process !== 'undefined' ? process.version : undefined;\n \n case 'deno':\n return typeof (globalThis as any).Deno !== 'undefined' \n ? (globalThis as any).Deno.version?.deno \n : undefined;\n \n case 'bun':\n return typeof (globalThis as any).Bun !== 'undefined'\n ? (globalThis as any).Bun.version\n : undefined;\n \n case 'browser':\n return typeof navigator !== 'undefined' ? navigator.userAgent : undefined;\n \n default:\n return undefined;\n }\n}\n\nfunction getRuntimeCapabilities(runtime: RuntimeName): RuntimeCapabilities {\n switch (runtime) {\n case 'node':\n return {\n fileSystem: true,\n colorSupport: true,\n processInfo: true,\n streams: true\n };\n \n case 'deno':\n return {\n fileSystem: true,\n colorSupport: true,\n processInfo: true,\n streams: true\n };\n \n case 'bun':\n return {\n fileSystem: true,\n colorSupport: true,\n processInfo: true,\n streams: true\n };\n \n case 'browser':\n return {\n fileSystem: false,\n colorSupport: true, // CSS styling in console\n processInfo: false,\n streams: false\n };\n \n case 'webworker':\n return {\n fileSystem: false,\n colorSupport: false,\n processInfo: false,\n streams: false\n };\n \n default:\n return {\n fileSystem: false,\n colorSupport: false,\n processInfo: false,\n streams: false\n };\n }\n}\n\n/**\n * Check if the current runtime is Node.js.\n * @returns True if running in Node.js\n */\nexport function isNode(): boolean {\n return detectRuntimeName() === 'node';\n}\n\n/**\n * Check if the current runtime is a browser.\n * @returns True if running in a browser\n */\nexport function isBrowser(): boolean {\n return detectRuntimeName() === 'browser';\n}\n\n/**\n * Check if the current runtime is Deno.\n * @returns True if running in Deno\n */\nexport function isDeno(): boolean {\n return detectRuntimeName() === 'deno';\n}\n\n/**\n * Check if the current runtime is Bun.\n * @returns True if running in Bun\n */\nexport function isBun(): boolean {\n return detectRuntimeName() === 'bun';\n}","/**\n * Safely stringify an object to JSON, handling circular references,\n * Error objects, functions, and other non-serializable values.\n * @param obj - The object to stringify\n * @param space - Number of spaces for pretty-printing (optional)\n * @returns JSON string representation\n */\nexport function safeStringify(obj: any, space?: number): string {\n const seen = new WeakSet();\n \n return JSON.stringify(obj, (key, value) => {\n // Handle circular references\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return '[Circular]';\n }\n seen.add(value);\n }\n \n // Handle Error objects\n if (value instanceof Error) {\n return {\n name: value.name,\n message: value.message,\n stack: value.stack,\n ...Object.getOwnPropertyNames(value).reduce((acc, prop) => {\n if (prop !== 'name' && prop !== 'message' && prop !== 'stack') {\n acc[prop] = (value as any)[prop];\n }\n return acc;\n }, {} as any)\n };\n }\n \n // Handle functions\n if (typeof value === 'function') {\n return `[Function: ${value.name || 'anonymous'}]`;\n }\n \n // Handle undefined (JSON.stringify normally omits these)\n if (value === undefined) {\n return '[undefined]';\n }\n \n // Handle BigInt\n if (typeof value === 'bigint') {\n return `[BigInt: ${value.toString()}]`;\n }\n \n // Handle Symbol\n if (typeof value === 'symbol') {\n return `[Symbol: ${value.toString()}]`;\n }\n \n return value;\n }, space);\n}\n\n/**\n * Filter out sensitive data from an object before logging.\n * @param obj - The object to filter\n * @param sensitiveKeys - Array of key names to redact (case-insensitive)\n * @returns A new object with sensitive values replaced with '[REDACTED]'\n * @example\n * ```typescript\n * const data = { username: 'john', password: 'secret123' };\n * const filtered = filterSensitiveData(data);\n * // Result: { username: 'john', password: '[REDACTED]' }\n * ```\n */\nexport function filterSensitiveData(obj: any, sensitiveKeys: string[] = ['password', 'token', 'secret', 'key', 'auth']): any {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n \n const filtered = Array.isArray(obj) ? [] : {};\n \n for (const [key, value] of Object.entries(obj)) {\n const shouldFilter = sensitiveKeys.some(sensitiveKey => \n key.toLowerCase().includes(sensitiveKey.toLowerCase())\n );\n \n if (shouldFilter) {\n (filtered as any)[key] = '[REDACTED]';\n } else if (typeof value === 'object' && value !== null) {\n (filtered as any)[key] = filterSensitiveData(value, sensitiveKeys);\n } else {\n (filtered as any)[key] = value;\n }\n }\n \n return filtered;\n}","import { \n ILogger, \n LogLevel, \n LogMessage, \n LogEntry,\n RuntimeName,\n LoggerConfig \n} from './types.ts';\nimport { detectRuntime } from '../utils/runtime.ts';\nimport { safeStringify } from '../utils/serialization.ts';\n\nexport abstract class BaseLogger implements ILogger {\n protected level: LogLevel;\n protected config: Partial<LoggerConfig>;\n protected runtime: RuntimeName;\n protected childMetadata: Record<string, any> = {};\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = config;\n this.level = config.level ?? LogLevel.INFO;\n this.runtime = detectRuntime().name;\n }\n\n debug(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.DEBUG, message, metadata);\n }\n\n info(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.INFO, message, metadata);\n }\n\n warn(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.WARN, message, metadata);\n }\n\n error(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.ERROR, message, metadata);\n }\n\n log(level: LogLevel, message: LogMessage, metadata?: any): void {\n if (!this.shouldLog(level)) {\n return;\n }\n\n const resolvedMessage = typeof message === 'function' ? message() : message;\n const combinedMetadata = { ...this.childMetadata, ...metadata };\n\n const entry: LogEntry = {\n timestamp: new Date(),\n level,\n message: resolvedMessage,\n metadata: Object.keys(combinedMetadata).length > 0 ? combinedMetadata : undefined,\n runtime: this.runtime\n };\n\n this.writeLog(entry);\n }\n\n setLevel(level: LogLevel): void {\n this.level = level;\n }\n\n getLevel(): LogLevel {\n return this.level;\n }\n\n child(metadata: Record<string, any>): ILogger {\n const childLogger = this.createChild();\n childLogger.childMetadata = { ...this.childMetadata, ...metadata };\n return childLogger;\n }\n\n protected shouldLog(level: LogLevel): boolean {\n return level >= this.level;\n }\n\n protected abstract writeLog(entry: LogEntry): void;\n protected abstract createChild(): BaseLogger;\n}\n\nexport function serializeError(error: any): any {\n if (error instanceof Error) {\n return {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...(error as any) // Include any additional properties\n };\n }\n return error;\n}\n\nexport function formatLogEntry(entry: LogEntry, format: 'json' | 'text' = 'text'): string {\n if (format === 'json') {\n return safeStringify({\n timestamp: entry.timestamp.toISOString(),\n level: LogLevel[entry.level].toLowerCase(),\n message: entry.message,\n metadata: entry.metadata,\n runtime: entry.runtime\n });\n }\n\n // Text format\n const timestamp = entry.timestamp.toISOString();\n const level = LogLevel[entry.level].toUpperCase();\n const metaStr = entry.metadata ? ` ${safeStringify(entry.metadata)}` : '';\n \n return `[${timestamp}] ${level}: ${entry.message}${metaStr}`;\n}","import { BaseLogger } from '../core/logger.ts';\nimport { LogEntry, LogLevel, LoggerConfig } from '../core/types.ts';\nimport { safeStringify } from '../utils/serialization.ts';\n\nexport class NodeLogger extends BaseLogger {\n private winston?: any;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n super(config);\n this.initializeWinston();\n }\n\n private async initializeWinston(): Promise<void> {\n try {\n // Try to load Winston if available\n // @ts-ignore - Optional peer dependency\n const winston = await import('winston');\n this.winston = this.createWinstonLogger(winston);\n } catch (error) {\n // Winston not available, will fall back to console\n console.warn('[logan-logger] Winston not found, falling back to console logging');\n }\n }\n\n private createWinstonLogger(winston: any): any {\n const logFormat = winston.format.combine(\n winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),\n winston.format.errors({ stack: true }),\n winston.format.json(),\n winston.format.prettyPrint()\n );\n\n const consoleFormat = winston.format.combine(\n winston.format.colorize(),\n winston.format.timestamp({ format: 'HH:mm:ss' }),\n winston.format.printf(({ timestamp, level, message, ...meta }: any) => {\n const metaStr = Object.keys(meta).length ? JSON.stringify(meta, null, 2) : '';\n return `${timestamp} [${level}]: ${message} ${metaStr}`;\n })\n );\n\n const logger = winston.createLogger({\n level: this.getWinstonLevel(this.level),\n format: logFormat,\n transports: [\n new winston.transports.Console({\n format: process.env.NODE_ENV === 'production' ? logFormat : consoleFormat,\n }),\n ],\n });\n\n // Add file transports for production\n if (process.env.NODE_ENV === 'production') {\n logger.add(\n new winston.transports.File({\n filename: 'logs/error.log',\n level: 'error',\n maxsize: 5242880, // 5MB\n maxFiles: 5,\n })\n );\n\n logger.add(\n new winston.transports.File({\n filename: 'logs/combined.log',\n maxsize: 5242880, // 5MB\n maxFiles: 10,\n })\n );\n }\n\n return logger;\n }\n\n protected writeLog(entry: LogEntry): void {\n if (this.winston) {\n this.winston.log({\n level: this.getWinstonLevel(entry.level),\n message: entry.message,\n timestamp: entry.timestamp,\n ...entry.metadata,\n });\n } else {\n // Fallback to console\n this.writeToConsole(entry);\n }\n }\n\n protected createChild(): BaseLogger {\n return new NodeLogger(this.config);\n }\n\n private writeToConsole(entry: LogEntry): void {\n const timestamp = entry.timestamp.toISOString();\n const level = LogLevel[entry.level].toLowerCase();\n const metaStr = entry.metadata ? ` ${safeStringify(entry.metadata)}` : '';\n const message = `[${timestamp}] ${level.toUpperCase()}: ${entry.message}${metaStr}`;\n\n switch (entry.level) {\n case LogLevel.DEBUG:\n console.debug(message);\n break;\n case LogLevel.INFO:\n console.info(message);\n break;\n case LogLevel.WARN:\n console.warn(message);\n break;\n case LogLevel.ERROR:\n console.error(message);\n break;\n }\n }\n\n private getWinstonLevel(level: LogLevel): string {\n switch (level) {\n case LogLevel.DEBUG:\n return 'debug';\n case LogLevel.INFO:\n return 'info';\n case LogLevel.WARN:\n return 'warn';\n case LogLevel.ERROR:\n return 'error';\n default:\n return 'info';\n }\n }\n\n setLevel(level: LogLevel): void {\n super.setLevel(level);\n if (this.winston) {\n this.winston.level = this.getWinstonLevel(level);\n }\n }\n}\n\n// Create Morgan-compatible stream\nexport function createMorganStream(logger: NodeLogger) {\n return {\n write: (message: string) => {\n logger.info(message.trim());\n },\n };\n}","import { BaseLogger } from '../core/logger.ts';\nimport { LogEntry, LogLevel, LoggerConfig } from '../core/types.ts';\nimport { safeStringify } from '../utils/serialization.ts';\n\nexport class BrowserLogger extends BaseLogger {\n constructor(config: Partial<LoggerConfig> = {}) {\n super(config);\n }\n\n protected writeLog(entry: LogEntry): void {\n const message = this.formatMessage(entry);\n const style = this.getConsoleStyle(entry.level);\n\n // Use safeStringify for metadata to handle circular references\n const metaStr = entry.metadata ? ` ${safeStringify(entry.metadata)}` : '';\n const fullMessage = `%c${message}${metaStr}`;\n\n switch (entry.level) {\n case LogLevel.DEBUG:\n if (console.debug) {\n console.debug(fullMessage, style);\n } else {\n console.log(fullMessage, style);\n }\n break;\n case LogLevel.INFO:\n console.info(fullMessage, style);\n break;\n case LogLevel.WARN:\n console.warn(fullMessage, style);\n break;\n case LogLevel.ERROR:\n console.error(fullMessage, style);\n break;\n }\n }\n\n protected createChild(): BaseLogger {\n return new BrowserLogger(this.config);\n }\n\n private formatMessage(entry: LogEntry): string {\n const timestamp = entry.timestamp.toISOString();\n const level = LogLevel[entry.level].toUpperCase();\n return `[${timestamp}] ${level}: ${entry.message}`;\n }\n\n private getConsoleStyle(level: LogLevel): string {\n if (!this.config.colorize) {\n return '';\n }\n\n switch (level) {\n case LogLevel.DEBUG:\n return 'color: #888; font-weight: normal;';\n case LogLevel.INFO:\n return 'color: #007acc; font-weight: normal;';\n case LogLevel.WARN:\n return 'color: #ff8c00; font-weight: bold;';\n case LogLevel.ERROR:\n return 'color: #dc3545; font-weight: bold;';\n default:\n return '';\n }\n }\n\n private shouldLogInProduction(): boolean {\n // Check various environment indicators\n const env = \n (globalThis as any).process?.env?.NODE_ENV ||\n (globalThis as any).process?.env?.NEXT_PUBLIC_APP_ENV ||\n 'development';\n \n return env !== 'production' || this.level <= LogLevel.ERROR;\n }\n\n protected shouldLog(level: LogLevel): boolean {\n // In browser, respect production environment\n if (!this.shouldLogInProduction() && level < LogLevel.ERROR) {\n return false;\n }\n \n return super.shouldLog(level);\n }\n}\n\n// Browser-specific utilities\nexport class ConsoleGroupLogger extends BrowserLogger {\n private groupStack: string[] = [];\n\n group(label: string): void {\n console.group(label);\n this.groupStack.push(label);\n }\n\n groupCollapsed(label: string): void {\n console.groupCollapsed(label);\n this.groupStack.push(label);\n }\n\n groupEnd(): void {\n console.groupEnd();\n this.groupStack.pop();\n }\n\n time(label: string): void {\n console.time(label);\n }\n\n timeEnd(label: string): void {\n console.timeEnd(label);\n }\n\n trace(message: string, metadata?: any): void {\n console.trace(message, metadata);\n }\n\n count(label?: string): void {\n console.count(label);\n }\n\n countReset(label?: string): void {\n console.countReset(label);\n }\n\n table(data: any): void {\n console.table(data);\n }\n}\n\n// Performance logging for browser\nexport class PerformanceLogger extends BrowserLogger {\n mark(name: string): void {\n if (typeof performance !== 'undefined' && performance.mark) {\n performance.mark(name);\n }\n }\n\n measure(name: string, startMark?: string, endMark?: string): void {\n if (typeof performance !== 'undefined' && performance.measure) {\n try {\n performance.measure(name, startMark, endMark);\n const entries = performance.getEntriesByName(name, 'measure');\n if (entries.length > 0) {\n const entry = entries[entries.length - 1];\n this.info(`Performance: ${name}`, {\n duration: entry.duration,\n startTime: entry.startTime\n });\n }\n } catch (error) {\n this.warn('Failed to measure performance', { name, error });\n }\n }\n }\n\n clearMarks(name?: string): void {\n if (typeof performance !== 'undefined' && performance.clearMarks) {\n performance.clearMarks(name);\n }\n }\n\n clearMeasures(name?: string): void {\n if (typeof performance !== 'undefined' && performance.clearMeasures) {\n performance.clearMeasures(name);\n }\n }\n}","import { LoggerConfig, LogLevel } from '../core/types.ts';\nimport { detectRuntime } from './runtime.ts';\n\nexport function getDefaultConfig(): LoggerConfig {\n const runtime = detectRuntime();\n \n return {\n level: LogLevel.INFO,\n format: 'text',\n timestamp: true,\n colorize: runtime.capabilities.colorSupport,\n metadata: {},\n transports: [\n {\n type: 'console',\n options: {}\n }\n ]\n };\n}\n\nexport function loadConfigFromEnvironment(): Partial<LoggerConfig> {\n const config: Partial<LoggerConfig> = {};\n \n // Check for environment variables\n if (typeof process !== 'undefined' && process.env) {\n const env = process.env;\n \n // Log level\n if (env.LOG_LEVEL) {\n config.level = stringToLogLevel(env.LOG_LEVEL);\n }\n \n // Format\n if (env.LOG_FORMAT && ['json', 'text'].includes(env.LOG_FORMAT)) {\n config.format = env.LOG_FORMAT as 'json' | 'text';\n }\n \n // Timestamp\n if (env.LOG_TIMESTAMP) {\n config.timestamp = env.LOG_TIMESTAMP.toLowerCase() === 'true';\n }\n \n // Colorize\n if (env.LOG_COLOR) {\n config.colorize = env.LOG_COLOR.toLowerCase() === 'true';\n }\n }\n \n return config;\n}\n\nexport async function loadConfigFromFile(configPath?: string): Promise<Partial<LoggerConfig>> {\n const runtime = detectRuntime();\n \n if (!runtime.capabilities.fileSystem) {\n return {};\n }\n \n const possiblePaths = configPath ? [configPath] : [\n 'logan.config.json',\n 'logan.config.js',\n '.loganrc.json',\n 'package.json' // Check for logan config in package.json\n ];\n \n for (const path of possiblePaths) {\n try {\n if (runtime.name === 'node') {\n return await loadNodeConfig(path);\n } else if (runtime.name === 'deno') {\n return await loadDenoConfig(path);\n } else if (runtime.name === 'bun') {\n return await loadBunConfig(path);\n }\n } catch (error) {\n // Continue to next path\n }\n }\n \n return {};\n}\n\nasync function loadNodeConfig(path: string): Promise<Partial<LoggerConfig>> {\n try {\n const fs = await import('fs/promises');\n const pathModule = await import('path');\n \n if (path.endsWith('.json')) {\n const content = await fs.readFile(path, 'utf-8');\n const parsed = JSON.parse(content);\n \n if (path === 'package.json') {\n return parsed.logan || {};\n }\n return parsed;\n } else if (path.endsWith('.js')) {\n const fullPath = pathModule.resolve(path);\n delete require.cache[fullPath]; // Clear cache\n const config = require(fullPath);\n return config.default || config;\n }\n } catch (error) {\n // File doesn't exist or can't be parsed\n }\n \n return {};\n}\n\nasync function loadDenoConfig(path: string): Promise<Partial<LoggerConfig>> {\n try {\n if (path.endsWith('.json')) {\n const content = await (globalThis as any).Deno.readTextFile(path);\n const parsed = JSON.parse(content);\n \n if (path === 'package.json') {\n return parsed.logan || {};\n }\n return parsed;\n } else if (path.endsWith('.js')) {\n const config = await import(/* @vite-ignore */ `./${path}`);\n return config.default || config;\n }\n } catch (error) {\n // File doesn't exist or can't be parsed\n }\n \n return {};\n}\n\nasync function loadBunConfig(path: string): Promise<Partial<LoggerConfig>> {\n // Bun can use Node.js-style require or ES modules\n return loadNodeConfig(path);\n}\n\nfunction stringToLogLevel(level: string): LogLevel {\n switch (level.toLowerCase()) {\n case 'debug':\n return LogLevel.DEBUG;\n case 'info':\n return LogLevel.INFO;\n case 'warn':\n case 'warning':\n return LogLevel.WARN;\n case 'error':\n return LogLevel.ERROR;\n case 'silent':\n case 'none':\n return LogLevel.SILENT;\n default:\n return LogLevel.INFO;\n }\n}\n\nexport function mergeConfigs(...configs: Partial<LoggerConfig>[]): LoggerConfig {\n const defaultConfig = getDefaultConfig();\n \n return configs.reduce<LoggerConfig>((merged, config) => ({\n ...merged,\n ...config,\n metadata: {\n ...merged.metadata,\n ...config.metadata\n },\n transports: config.transports || merged.transports\n }), defaultConfig);\n}","import { ILogger, LoggerConfig, LogLevel } from './types.ts';\nimport { detectRuntime } from '../utils/runtime.ts';\nimport { NodeLogger } from '../runtime/node.ts';\nimport { BrowserLogger } from '../runtime/browser.ts';\nimport { getDefaultConfig } from '../utils/config.ts';\n\n/**\n * Factory class for creating logger instances based on the detected runtime.\n */\nexport class LoggerFactory {\n /**\n * Create a logger instance appropriate for the current runtime.\n * @param config - Optional configuration for the logger\n * @returns A logger instance\n */\n static create(config: Partial<LoggerConfig> = {}): ILogger {\n const runtime = detectRuntime();\n const mergedConfig = this.mergeConfig(config);\n\n switch (runtime.name) {\n case 'node':\n return new NodeLogger(mergedConfig);\n \n case 'deno':\n // For now, use console-based logger for Deno\n // TODO: Implement Deno-specific logger\n return new BrowserLogger(mergedConfig);\n \n case 'bun':\n // For now, use Node.js logger for Bun (similar APIs)\n return new NodeLogger(mergedConfig);\n \n case 'browser':\n case 'webworker':\n return new BrowserLogger(mergedConfig);\n \n default:\n // Fallback to console-based logger\n return new BrowserLogger(mergedConfig);\n }\n }\n\n /**\n * Create a child logger with additional metadata.\n * @param parent - The parent logger instance\n * @param metadata - Additional metadata to include in all child log messages\n * @returns A new logger instance with the additional metadata\n */\n static createChild(parent: ILogger, metadata: Record<string, any>): ILogger {\n return parent.child(metadata);\n }\n\n private static mergeConfig(userConfig: Partial<LoggerConfig>): Partial<LoggerConfig> {\n const defaultConfig = getDefaultConfig();\n return {\n ...defaultConfig,\n ...userConfig,\n metadata: {\n ...defaultConfig.metadata,\n ...userConfig.metadata\n }\n };\n }\n}\n\n/**\n * Convenience function for creating a logger instance.\n * @param config - Optional configuration for the logger\n * @returns A logger instance appropriate for the current runtime\n * @example\n * ```typescript\n * import { createLogger, LogLevel } from 'logan-logger';\n * \n * const logger = createLogger({\n * level: LogLevel.DEBUG,\n * colorize: true\n * });\n * \n * logger.info('Hello world!');\n * ```\n */\nexport function createLogger(config?: Partial<LoggerConfig>): ILogger {\n return LoggerFactory.create(config);\n}\n\n/**\n * Create a logger with configuration based on the current environment.\n * Automatically detects production/development/test environments and\n * sets appropriate log levels and formatting.\n * @returns A logger instance configured for the current environment\n */\nexport function createLoggerForEnvironment(): ILogger {\n const env = getEnvironment();\n \n const config: Partial<LoggerConfig> = {\n level: getLogLevelForEnvironment(env),\n colorize: env !== 'production',\n timestamp: true,\n format: env === 'production' ? 'json' : 'text'\n };\n\n return createLogger(config);\n}\n\nfunction getEnvironment(): string {\n // Check various environment variables\n if (typeof process !== 'undefined' && process.env) {\n return process.env.NODE_ENV || \n process.env.NEXT_PUBLIC_APP_ENV || \n process.env.ENVIRONMENT || \n 'development';\n }\n \n // Browser environment detection\n if (typeof window !== 'undefined') {\n // Check for common build-time environment indicators\n return (globalThis as any).__ENV__ || 'development';\n }\n \n return 'development';\n}\n\nfunction getLogLevelForEnvironment(env: string): LogLevel {\n switch (env) {\n case 'production':\n return LogLevel.ERROR;\n case 'staging':\n case 'test':\n return LogLevel.WARN;\n case 'development':\n case 'dev':\n return LogLevel.DEBUG;\n default:\n return LogLevel.INFO;\n }\n}\n\n// Type-safe log level conversion\nexport function stringToLogLevel(level: string): LogLevel {\n switch (level.toLowerCase()) {\n case 'debug':\n return LogLevel.DEBUG;\n case 'info':\n return LogLevel.INFO;\n case 'warn':\n case 'warning':\n return LogLevel.WARN;\n case 'error':\n return LogLevel.ERROR;\n case 'silent':\n case 'none':\n return LogLevel.SILENT;\n default:\n return LogLevel.INFO;\n }\n}\n\nexport function logLevelToString(level: LogLevel): string {\n switch (level) {\n case LogLevel.DEBUG:\n return 'debug';\n case LogLevel.INFO:\n return 'info';\n case LogLevel.WARN:\n return 'warn';\n case LogLevel.ERROR:\n return 'error';\n case LogLevel.SILENT:\n return 'silent';\n default:\n return 'info';\n }\n}","// Main entry point for logan-logger\nexport * from './core/types.ts';\nexport * from './core/logger.ts';\nexport * from './core/factory.ts';\n\n// Runtime-specific exports\nexport { NodeLogger, createMorganStream } from './runtime/node.ts';\nexport { BrowserLogger, ConsoleGroupLogger, PerformanceLogger } from './runtime/browser.ts';\n\n// Utilities\nexport * from './utils/runtime.ts';\nexport * from './utils/config.ts';\nexport * from './utils/serialization.ts';\n\n// Main factory function (available as named export)\n\n// Convenience exports for common use cases\nimport { createLogger, createLoggerForEnvironment } from './core/factory.ts';\nimport { LogLevel, ILogger } from './core/types.ts';\n\n// Pre-configured loggers for different environments\nexport const logger: ILogger = createLoggerForEnvironment();\n\n// Legacy compatibility - matches your existing client/server code\nexport const log = {\n debug: (message: string, meta?: any): void => logger.debug(message, meta),\n info: (message: string, meta?: any): void => logger.info(message, meta),\n warn: (message: string, meta?: any): void => logger.warn(message, meta),\n error: (message: string, meta?: any): void => logger.error(message, meta),\n};\n\n// Named exports for explicit imports\nexport {\n createLogger,\n createLoggerForEnvironment,\n LogLevel\n};\n\n// Type-only exports for better tree-shaking\nexport type {\n ILogger,\n LoggerConfig,\n RuntimeInfo,\n RuntimeCapabilities,\n LogEntry,\n LogMessage,\n LogLevelString,\n RuntimeName,\n TransportConfig,\n ILoggerAdapter\n} from './core/types.ts';"],"names":["LogLevel","detectRuntime","name","detectRuntimeName","version","getRuntimeVersion","capabilities","getRuntimeCapabilities","runtime","isNode","isBrowser","isDeno","isBun","safeStringify","obj","space","seen","key","value","acc","prop","filterSensitiveData","sensitiveKeys","filtered","sensitiveKey","BaseLogger","config","message","metadata","level","resolvedMessage","combinedMetadata","entry","childLogger","serializeError","error","formatLogEntry","format","timestamp","metaStr","NodeLogger","winston","logFormat","consoleFormat","meta","logger","createMorganStream","BrowserLogger","style","fullMessage","ConsoleGroupLogger","label","data","PerformanceLogger","startMark","endMark","entries","getDefaultConfig","loadConfigFromEnvironment","env","stringToLogLevel","loadConfigFromFile","configPath","possiblePaths","path","loadNodeConfig","loadDenoConfig","loadBunConfig","fs","pathModule","content","parsed","fullPath","mergeConfigs","configs","defaultConfig","merged","LoggerFactory","mergedConfig","parent","userConfig","createLogger","createLoggerForEnvironment","getEnvironment","getLogLevelForEnvironment","logLevelToString","log"],"mappings":"AAIO,IAAKA,sBAAAA,OAEVA,EAAAA,EAAA,QAAQ,CAAA,IAAR,SAEAA,EAAAA,EAAA,OAAO,CAAA,IAAP,QAEAA,EAAAA,EAAA,OAAO,CAAA,IAAP,QAEAA,EAAAA,EAAA,QAAQ,CAAA,IAAR,SAEAA,EAAAA,EAAA,SAAS,CAAA,IAAT,UAVUA,IAAAA,KAAA,CAAA,CAAA;ACOL,SAASC,IAA6B;AAC3C,QAAMC,IAAOC,EAAA,GACPC,IAAUC,EAAkBH,CAAI,GAChCI,IAAeC,EAAuBL,CAAI;AAEhD,SAAO;AAAA,IACL,MAAAA;AAAA,IACA,SAAAE;AAAA,IACA,cAAAE;AAAA,EAAA;AAEJ;AAEA,SAASH,IAAiC;AAExC,SAAI,OAAQ,WAAmB,OAAS,MAC/B,SAIL,OAAQ,WAAmB,MAAQ,MAC9B,QAIL,OAAO,SAAW,OAAe,OAAO,WAAa,MAChD,YAIL,OAAQ,WAAmB,iBAAkB,cAAc,OAAO,SAAW,MACxE,cAIL,OAAO,UAAY,OAAe,QAAQ,YAAY,QAAQ,SAAS,OAClE,SAGF;AACT;AAEA,SAASE,EAAkBG,GAA0C;AACnE,UAAQA,GAAA;AAAA,IACN,KAAK;A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A,IAClB,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAS;AAAA,IAClB;AACE,aAAOA,EAAS;AAAA,EAAA;AAEtB;AAGO,SAAS4D,EAAiB/B,GAAyB;AACxD,UAAQA,EAAM,eAAY;AAAA,IACxB,KAAK;AACH,aAAO7B,EAAS;AAAA,IAClB,KAAK;AACH,aAAOA,EAAS;AAAA,IAClB,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAS;AAAA,IAClB,KAAK;AACH,aAAOA,EAAS;AAAA,IAClB,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAS;AAAA,IAClB;AACE,aAAOA,EAAS;AAAA,EAAA;AAEtB;AAEO,SAASqF,EAAiBxD,GAAyB;AACxD,UAAQA,GAAA;AAAA,IACN,KAAK7B,EAAS;AACZ,aAAO;AAAA,IACT,KAAKA,EAAS;AACZ,aAAO;AAAA,IACT,KAAKA,EAAS;AACZ,aAAO;AAAA,IACT,KAAKA,EAAS;AACZ,aAAO;AAAA,IACT,KAAKA,EAAS;AACZ,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;ACvJO,MAAM6C,IAAkBqC,EAAA,GAGlBI,IAAM;AAAA,EACjB,OAAO,CAAC3D,GAAiBiB,MAAqBC,EAAO,MAAMlB,GAASiB,CAAI;AAAA,EACxE,MAAM,CAACjB,GAAiBiB,MAAqBC,EAAO,KAAKlB,GAASiB,CAAI;AAAA,EACtE,MAAM,CAACjB,GAAiBiB,MAAqBC,EAAO,KAAKlB,GAASiB,CAAI;AAAA,EACtE,OAAO,CAACjB,GAAiBiB,MAAqBC,EAAO,MAAMlB,GAASiB,CAAI;AAC1E;"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var S=Object.create;var w=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var I=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of C(e))!k.call(t,o)&&o!==r&&w(t,o,{get:()=>e[o],enumerable:!(s=y(e,o))||s.enumerable});return t};var T=(t,e,r)=>(r=t!=null?S(F(t)):{},I(e||!t||!t.__esModule?w(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.SILENT=4]="SILENT",t))(n||{});function m(){const t=g(),e=D(t),r=M(t);return{name:t,version:e,capabilities:r}}function g(){return typeof globalThis.Deno<"u"?"deno":typeof globalThis.Bun<"u"?"bun":typeof window<"u"&&typeof document<"u"?"browser":typeof globalThis.importScripts=="function"&&typeof window>"u"?"webworker":typeof process<"u"&&process.versions&&process.versions.node?"node":"unknown"}function D(t){switch(t){case"node":return typeof process<"u"?process.version:void 0;case"deno":return typeof globalThis.Deno<"u"?globalThis.Deno.version?.deno:void 0;case"bun":return typeof globalThis.Bun<"u"?globalThis.Bun.version:void 0;case"browser":return typeof navigator<"u"?navigator.userAgent:void 0;default:return}}function M(t){switch(t){case"node":return{fileSystem:!0,colorSupport:!0,processInfo:!0,streams:!0};case"deno":return{fileSystem:!0,colorSupport:!0,processInfo:!0,streams:!0};case"bun":return{fileSystem:!0,colorSupport:!0,processInfo:!0,streams:!0};case"browser":return{fileSystem:!1,colorSupport:!0,processInfo:!1,streams:!1};case"webworker":return{fileSystem:!1,colorSupport:!1,processInfo:!1,streams:!1};default:return{fileSystem:!1,colorSupport:!1,processInfo:!1,streams:!1}}}function B(){return g()==="node"}function $(){return g()==="browser"}function W(){return g()==="deno"}function A(){return g()==="bun"}function l(t,e){const r=new WeakSet;return JSON.stringify(t,(s,o)=>{if(typeof o=="object"&&o!==null){if(r.has(o))return"[Circular]";r.add(o)}return o instanceof Error?{name:o.name,message:o.message,stack:o.stack,...Object.getOwnPropertyNames(o).reduce((a,i)=>(i!=="name"&&i!=="message"&&i!=="stack"&&(a[i]=o[i]),a),{})}:typeof o=="function"?`[Function: ${o.name||"anonymous"}]`:o===void 0?"[undefined]":typeof o=="bigint"?`[BigInt: ${o.toString()}]`:typeof o=="symbol"?`[Symbol: ${o.toString()}]`:o},e)}function E(t,e=["password","token","secret","key","auth"]){if(typeof t!="object"||t===null)return t;const r=Array.isArray(t)?[]:{};for(const[s,o]of Object.entries(t))e.some(i=>s.toLowerCase().includes(i.toLowerCase()))?r[s]="[REDACTED]":typeof o=="object"&&o!==null?r[s]=E(o,e):r[s]=o;return r}class d{constructor(e={}){this.childMetadata={},this.config=e,this.level=e.level??n.INFO,this.runtime=m().name}debug(e,r){this.log(n.DEBUG,e,r)}info(e,r){this.log(n.INFO,e,r)}warn(e,r){this.log(n.WARN,e,r)}error(e,r){this.log(n.ERROR,e,r)}log(e,r,s){if(!this.shouldLog(e))return;const o=typeof r=="function"?r():r,a={...this.childMetadata,...s},i={timestamp:new Date,level:e,message:o,metadata:Object.keys(a).length>0?a:void 0,runtime:this.runtime};this.writeLog(i)}setLevel(e){this.level=e}getLevel(){return this.level}child(e){const r=this.createChild();return r.childMetadata={...this.childMetadata,...e},r}shouldLog(e){return e>=this.level}}function G(t){return t instanceof Error?{name:t.name,message:t.message,stack:t.stack,...t}:t}function _(t,e="text"){if(e==="json")return l({timestamp:t.timestamp.toISOString(),level:n[t.level].toLowerCase(),message:t.message,metadata:t.metadata,runtime:t.runtime});const r=t.timestamp.toISOString(),s=n[t.level].toUpperCase(),o=t.metadata?` ${l(t.metadata)}`:"";return`[${r}] ${s}: ${t.message}${o}`}class f extends d{constructor(e={}){super(e),this.initializeWinston()}async initializeWinston(){try{const e=await import("winston");this.winston=this.createWinstonLogger(e)}catch{console.warn("[logan-logger] Winston not found, falling back to console logging")}}createWinstonLogger(e){const r=e.format.combine(e.format.timestamp({format:"YYYY-MM-DD HH:mm:ss"}),e.format.errors({stack:!0}),e.format.json(),e.format.prettyPrint()),s=e.format.combine(e.format.colorize(),e.format.timestamp({format:"HH:mm:ss"}),e.format.printf(({timestamp:a,level:i,message:L,...h})=>{const N=Object.keys(h).length?JSON.stringify(h,null,2):"";return`${a} [${i}]: ${L} ${N}`})),o=e.createLogger({level:this.getWinstonLevel(this.level),format:r,transports:[new e.transports.Console({format:process.env.NODE_ENV==="production"?r:s})]});return process.env.NODE_ENV==="production"&&(o.add(new e.transports.File({filename:"logs/error.log",level:"error",maxsize:5242880,maxFiles:5})),o.add(new e.transports.File({filename:"logs/combined.log",maxsize:5242880,maxFiles:10}))),o}writeLog(e){this.winston?this.winston.log({level:this.getWinstonLevel(e.level),message:e.message,timestamp:e.timestamp,...e.metadata}):this.writeToConsole(e)}createChild(){return new f(this.config)}writeToConsole(e){const r=e.timestamp.toISOString(),s=n[e.level].toLowerCase(),o=e.metadata?` ${l(e.metadata)}`:"",a=`[${r}] ${s.toUpperCase()}: ${e.message}${o}`;switch(e.level){case n.DEBUG:console.debug(a);break;case n.INFO:console.info(a);break;case n.WARN:console.warn(a);break;case n.ERROR:console.error(a);break}}getWinstonLevel(e){switch(e){case n.DEBUG:return"debug";case n.INFO:return"info";case n.WARN:return"warn";case n.ERROR:return"error";default:return"info"}}setLevel(e){super.setLevel(e),this.winston&&(this.winston.level=this.getWinstonLevel(e))}}function P(t){return{write:e=>{t.info(e.trim())}}}class c extends d{constructor(e={}){super(e)}writeLog(e){const r=this.formatMessage(e),s=this.getConsoleStyle(e.level),o=e.metadata?` ${l(e.metadata)}`:"",a=`%c${r}${o}`;switch(e.level){case n.DEBUG:console.debug?console.debug(a,s):console.log(a,s);break;case n.INFO:console.info(a,s);break;case n.WARN:console.warn(a,s);break;case n.ERROR:console.error(a,s);break}}createChild(){return new c(this.config)}formatMessage(e){const r=e.timestamp.toISOString(),s=n[e.level].toUpperCase();return`[${r}] ${s}: ${e.message}`}getConsoleStyle(e){if(!this.config.colorize)return"";switch(e){case n.DEBUG:return"color: #888; font-weight: normal;";case n.INFO:return"color: #007acc; font-weight: normal;";case n.WARN:return"color: #ff8c00; font-weight: bold;";case n.ERROR:return"color: #dc3545; font-weight: bold;";default:return""}}shouldLogInProduction(){return(globalThis.process?.env?.NODE_ENV||globalThis.process?.env?.NEXT_PUBLIC_APP_ENV||"development")!=="production"||this.level<=n.ERROR}shouldLog(e){return!this.shouldLogInProduction()&&e<n.ERROR?!1:super.shouldLog(e)}}class j extends c{constructor(){super(...arguments),this.groupStack=[]}group(e){console.group(e),this.groupStack.push(e)}groupCollapsed(e){console.groupCollapsed(e),this.groupStack.push(e)}groupEnd(){console.groupEnd(),this.groupStack.pop()}time(e){console.time(e)}timeEnd(e){console.timeEnd(e)}trace(e,r){console.trace(e,r)}count(e){console.count(e)}countReset(e){console.countReset(e)}table(e){console.table(e)}}class U extends c{mark(e){typeof performance<"u"&&performance.mark&&performance.mark(e)}measure(e,r,s){if(typeof performance<"u"&&performance.measure)try{performance.measure(e,r,s);const o=performance.getEntriesByName(e,"measure");if(o.length>0){const a=o[o.length-1];this.info(`Performance: ${e}`,{duration:a.duration,startTime:a.startTime})}}catch(o){this.warn("Failed to measure performance",{name:e,error:o})}}clearMarks(e){typeof performance<"u"&&performance.clearMarks&&performance.clearMarks(e)}clearMeasures(e){typeof performance<"u"&&performance.clearMeasures&&performance.clearMeasures(e)}}function p(){const t=m();return{level:n.INFO,format:"text",timestamp:!0,colorize:t.capabilities.colorSupport,metadata:{},transports:[{type:"console",options:{}}]}}function x(){const t={};if(typeof process<"u"&&process.env){const e=process.env;e.LOG_LEVEL&&(t.level=H(e.LOG_LEVEL)),e.LOG_FORMAT&&["json","text"].includes(e.LOG_FORMAT)&&(t.format=e.LOG_FORMAT),e.LOG_TIMESTAMP&&(t.timestamp=e.LOG_TIMESTAMP.toLowerCase()==="true"),e.LOG_COLOR&&(t.colorize=e.LOG_COLOR.toLowerCase()==="true")}return t}async function z(t){const e=m();if(!e.capabilities.fileSystem)return{};const r=t?[t]:["logan.config.json","logan.config.js",".loganrc.json","package.json"];for(const s of r)try{if(e.name==="node")return await R(s);if(e.name==="deno")return await V(s);if(e.name==="bun")return await q(s)}catch{}return{}}async function R(t){try{const e=await Promise.resolve().then(()=>require("./__vite-browser-external-BcPniuRQ.js")),r=await Promise.resolve().then(()=>require("./__vite-browser-external-BcPniuRQ.js"));if(t.endsWith(".json")){const s=await e.readFile(t,"utf-8"),o=JSON.parse(s);return t==="package.json"?o.logan||{}:o}else if(t.endsWith(".js")){const s=r.resolve(t);delete require.cache[s];const o=require(s);return o.default||o}}catch{}return{}}async function V(t){try{if(t.endsWith(".json")){const e=await globalThis.Deno.readTextFile(t),r=JSON.parse(e);return t==="package.json"?r.logan||{}:r}else if(t.endsWith(".js")){const e=await import(`./${t}`);return e.default||e}}catch{}return{}}async function q(t){return R(t)}function H(t){switch(t.toLowerCase()){case"debug":return n.DEBUG;case"info":return n.INFO;case"warn":case"warning":return n.WARN;case"error":return n.ERROR;case"silent":case"none":return n.SILENT;default:return n.INFO}}function J(...t){const e=p();return t.reduce((r,s)=>({...r,...s,metadata:{...r.metadata,...s.metadata},transports:s.transports||r.transports}),e)}class b{static create(e={}){const r=m(),s=this.mergeConfig(e);switch(r.name){case"node":return new f(s);case"deno":return new c(s);case"bun":return new f(s);case"browser":case"webworker":return new c(s);default:return new c(s)}}static createChild(e,r){return e.child(r)}static mergeConfig(e){const r=p();return{...r,...e,metadata:{...r.metadata,...e.metadata}}}}function O(t){return b.create(t)}function v(){const t=Y(),e={level:X(t),colorize:t!=="production",timestamp:!0,format:t==="production"?"json":"text"};return O(e)}function Y(){return typeof process<"u"&&process.env?process.env.NODE_ENV||process.env.NEXT_PUBLIC_APP_ENV||process.env.ENVIRONMENT||"development":typeof window<"u"&&globalThis.__ENV__||"development"}function X(t){switch(t){case"production":return n.ERROR;case"staging":case"test":return n.WARN;case"development":case"dev":return n.DEBUG;default:return n.INFO}}function Q(t){switch(t.toLowerCase()){case"debug":return n.DEBUG;case"info":return n.INFO;case"warn":case"warning":return n.WARN;case"error":return n.ERROR;case"silent":case"none":return n.SILENT;default:return n.INFO}}function Z(t){switch(t){case n.DEBUG:return"debug";case n.INFO:return"info";case n.WARN:return"warn";case n.ERROR:return"error";case n.SILENT:return"silent";default:return"info"}}const u=v(),K={debug:(t,e)=>u.debug(t,e),info:(t,e)=>u.info(t,e),warn:(t,e)=>u.warn(t,e),error:(t,e)=>u.error(t,e)};exports.BaseLogger=d;exports.BrowserLogger=c;exports.ConsoleGroupLogger=j;exports.LogLevel=n;exports.LoggerFactory=b;exports.NodeLogger=f;exports.PerformanceLogger=U;exports.createLogger=O;exports.createLoggerForEnvironment=v;exports.createMorganStream=P;exports.detectRuntime=m;exports.filterSensitiveData=E;exports.formatLogEntry=_;exports.getDefaultConfig=p;exports.isBrowser=$;exports.isBun=A;exports.isDeno=W;exports.isNode=B;exports.loadConfigFromEnvironment=x;exports.loadConfigFromFile=z;exports.log=K;exports.logLevelToString=Z;exports.logger=u;exports.mergeConfigs=J;exports.safeStringify=l;exports.serializeError=G;exports.stringToLogLevel=Q;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/core/types.ts","../src/utils/runtime.ts","../src/utils/serialization.ts","../src/core/logger.ts","../src/runtime/node.ts","../src/runtime/browser.ts","../src/utils/config.ts","../src/core/factory.ts","../src/index.ts"],"sourcesContent":["/**\n * Log levels in ascending order of severity.\n * Used to filter which messages should be logged.\n */\nexport enum LogLevel {\n /** Debug messages - most verbose */\n DEBUG = 0,\n /** Informational messages */\n INFO = 1,\n /** Warning messages */\n WARN = 2,\n /** Error messages */\n ERROR = 3,\n /** No messages - silent mode */\n SILENT = 4\n}\n\n/**\n * String representation of log levels.\n */\nexport type LogLevelString = 'debug' | 'info' | 'warn' | 'error' | 'silent';\n\n/**\n * Supported JavaScript runtime environments.\n */\nexport type RuntimeName = 'node' | 'deno' | 'bun' | 'browser' | 'webworker' | 'unknown';\n\n/**\n * Information about the detected JavaScript runtime environment.\n */\nexport interface RuntimeInfo {\n /** The name of the runtime */\n name: RuntimeName;\n /** Version string of the runtime (if available) */\n version?: string;\n /** Capabilities supported by this runtime */\n capabilities: RuntimeCapabilities;\n}\n\n/**\n * Capabilities that a runtime may or may not support.\n */\nexport interface RuntimeCapabilities {\n /** Whether the runtime supports file system operations */\n fileSystem: boolean;\n /** Whether the runtime supports colored console output */\n colorSupport: boolean;\n /** Whether the runtime provides process information */\n processInfo: boolean;\n /** Whether the runtime supports streams */\n streams: boolean;\n}\n\n/**\n * Configuration options for creating a logger instance.\n */\nexport interface LoggerConfig {\n /** Minimum log level to output */\n level: LogLevel;\n /** Output format for log messages */\n format: 'json' | 'text' | 'custom';\n /** Whether to include timestamps in log output */\n timestamp: boolean;\n /** Whether to colorize log output (if supported) */\n colorize: boolean;\n /** Default metadata to include with all log messages */\n metadata: Record<string, any>;\n /** Transport configurations for log output */\n transports?: TransportConfig[];\n}\n\n/**\n * Configuration for a specific log transport (output destination).\n */\nexport interface TransportConfig {\n /** Type of transport */\n type: 'console' | 'file' | 'http' | 'custom';\n /** Minimum log level for this transport */\n level?: LogLevel;\n /** Transport-specific options */\n options: Record<string, any>;\n}\n\n/**\n * A log message can be a string or a function that returns a string.\n * Functions enable lazy evaluation for expensive log message generation.\n */\nexport type LogMessage = string | (() => string);\n\n/**\n * Internal representation of a log entry.\n */\nexport interface LogEntry {\n /** When the log entry was created */\n timestamp: Date;\n /** Log level of this entry */\n level: LogLevel;\n /** The log message */\n message: string;\n /** Additional structured data */\n metadata?: Record<string, any>;\n /** Runtime that generated this log entry */\n runtime: RuntimeName;\n}\n\n/**\n * Main logger interface providing methods for logging at different levels.\n * This interface is implemented by all logger implementations across different runtimes.\n */\nexport interface ILogger {\n /**\n * Log a debug message. Only shown when log level is DEBUG.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n debug(message: LogMessage, metadata?: any): void;\n \n /**\n * Log an informational message.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n info(message: LogMessage, metadata?: any): void;\n \n /**\n * Log a warning message.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n warn(message: LogMessage, metadata?: any): void;\n \n /**\n * Log an error message.\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n error(message: LogMessage, metadata?: any): void;\n \n /**\n * Log a message at a specific level.\n * @param level - The log level\n * @param message - The message to log (string or lazy function)\n * @param metadata - Optional structured data to include\n */\n log(level: LogLevel, message: LogMessage, metadata?: any): void;\n \n /**\n * Set the minimum log level for this logger.\n * @param level - The minimum log level\n */\n setLevel(level: LogLevel): void;\n \n /**\n * Get the current minimum log level.\n * @returns The current log level\n */\n getLevel(): LogLevel;\n \n /**\n * Create a child logger with additional metadata.\n * @param metadata - Additional metadata to include in all child log messages\n * @returns A new logger instance with the additional metadata\n */\n child(metadata: Record<string, any>): ILogger;\n}\n\n/**\n * Interface for logger adapters that handle the actual log output.\n * This abstraction allows different implementations for different runtimes.\n */\nexport interface ILoggerAdapter {\n /**\n * Write a log entry to the output destination.\n * @param entry - The log entry to write\n */\n log(entry: LogEntry): void;\n \n /**\n * Set the minimum log level for this adapter.\n * @param level - The minimum log level\n */\n setLevel(level: LogLevel): void;\n \n /**\n * Get the current minimum log level.\n * @returns The current log level\n */\n getLevel(): LogLevel;\n}","import { RuntimeInfo, RuntimeName, RuntimeCapabilities } from '../core/types.ts';\n\n/**\n * Detects the current JavaScript runtime environment and its capabilities.\n * @returns Information about the detected runtime\n * @example\n * ```typescript\n * const runtime = detectRuntime();\n * console.log(`Running on: ${runtime.name} ${runtime.version}`);\n * ```\n */\nexport function detectRuntime(): RuntimeInfo {\n const name = detectRuntimeName();\n const version = getRuntimeVersion(name);\n const capabilities = getRuntimeCapabilities(name);\n\n return {\n name,\n version,\n capabilities\n };\n}\n\nfunction detectRuntimeName(): RuntimeName {\n // Check for Deno\n if (typeof (globalThis as any).Deno !== 'undefined') {\n return 'deno';\n }\n\n // Check for Bun\n if (typeof (globalThis as any).Bun !== 'undefined') {\n return 'bun';\n }\n\n // Check for browser environment\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n return 'browser';\n }\n\n // Check for Web Worker\n if (typeof (globalThis as any).importScripts === 'function' && typeof window === 'undefined') {\n return 'webworker';\n }\n\n // Check for Node.js\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n return 'node';\n }\n\n return 'unknown';\n}\n\nfunction getRuntimeVersion(runtime: RuntimeName): string | undefined {\n switch (runtime) {\n case 'node':\n return typeof process !== 'undefined' ? process.version : undefined;\n \n case 'deno':\n return typeof (globalThis as any).Deno !== 'undefined' \n ? (globalThis as any).Deno.version?.deno \n : undefined;\n \n case 'bun':\n return typeof (globalThis as any).Bun !== 'undefined'\n ? (globalThis as any).Bun.version\n : undefined;\n \n case 'browser':\n return typeof navigator !== 'undefined' ? navigator.userAgent : undefined;\n \n default:\n return undefined;\n }\n}\n\nfunction getRuntimeCapabilities(runtime: RuntimeName): RuntimeCapabilities {\n switch (runtime) {\n case 'node':\n return {\n fileSystem: true,\n colorSupport: true,\n processInfo: true,\n streams: true\n };\n \n case 'deno':\n return {\n fileSystem: true,\n colorSupport: true,\n processInfo: true,\n streams: true\n };\n \n case 'bun':\n return {\n fileSystem: true,\n colorSupport: true,\n processInfo: true,\n streams: true\n };\n \n case 'browser':\n return {\n fileSystem: false,\n colorSupport: true, // CSS styling in console\n processInfo: false,\n streams: false\n };\n \n case 'webworker':\n return {\n fileSystem: false,\n colorSupport: false,\n processInfo: false,\n streams: false\n };\n \n default:\n return {\n fileSystem: false,\n colorSupport: false,\n processInfo: false,\n streams: false\n };\n }\n}\n\n/**\n * Check if the current runtime is Node.js.\n * @returns True if running in Node.js\n */\nexport function isNode(): boolean {\n return detectRuntimeName() === 'node';\n}\n\n/**\n * Check if the current runtime is a browser.\n * @returns True if running in a browser\n */\nexport function isBrowser(): boolean {\n return detectRuntimeName() === 'browser';\n}\n\n/**\n * Check if the current runtime is Deno.\n * @returns True if running in Deno\n */\nexport function isDeno(): boolean {\n return detectRuntimeName() === 'deno';\n}\n\n/**\n * Check if the current runtime is Bun.\n * @returns True if running in Bun\n */\nexport function isBun(): boolean {\n return detectRuntimeName() === 'bun';\n}","/**\n * Safely stringify an object to JSON, handling circular references,\n * Error objects, functions, and other non-serializable values.\n * @param obj - The object to stringify\n * @param space - Number of spaces for pretty-printing (optional)\n * @returns JSON string representation\n */\nexport function safeStringify(obj: any, space?: number): string {\n const seen = new WeakSet();\n \n return JSON.stringify(obj, (key, value) => {\n // Handle circular references\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return '[Circular]';\n }\n seen.add(value);\n }\n \n // Handle Error objects\n if (value instanceof Error) {\n return {\n name: value.name,\n message: value.message,\n stack: value.stack,\n ...Object.getOwnPropertyNames(value).reduce((acc, prop) => {\n if (prop !== 'name' && prop !== 'message' && prop !== 'stack') {\n acc[prop] = (value as any)[prop];\n }\n return acc;\n }, {} as any)\n };\n }\n \n // Handle functions\n if (typeof value === 'function') {\n return `[Function: ${value.name || 'anonymous'}]`;\n }\n \n // Handle undefined (JSON.stringify normally omits these)\n if (value === undefined) {\n return '[undefined]';\n }\n \n // Handle BigInt\n if (typeof value === 'bigint') {\n return `[BigInt: ${value.toString()}]`;\n }\n \n // Handle Symbol\n if (typeof value === 'symbol') {\n return `[Symbol: ${value.toString()}]`;\n }\n \n return value;\n }, space);\n}\n\n/**\n * Filter out sensitive data from an object before logging.\n * @param obj - The object to filter\n * @param sensitiveKeys - Array of key names to redact (case-insensitive)\n * @returns A new object with sensitive values replaced with '[REDACTED]'\n * @example\n * ```typescript\n * const data = { username: 'john', password: 'secret123' };\n * const filtered = filterSensitiveData(data);\n * // Result: { username: 'john', password: '[REDACTED]' }\n * ```\n */\nexport function filterSensitiveData(obj: any, sensitiveKeys: string[] = ['password', 'token', 'secret', 'key', 'auth']): any {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n \n const filtered = Array.isArray(obj) ? [] : {};\n \n for (const [key, value] of Object.entries(obj)) {\n const shouldFilter = sensitiveKeys.some(sensitiveKey => \n key.toLowerCase().includes(sensitiveKey.toLowerCase())\n );\n \n if (shouldFilter) {\n (filtered as any)[key] = '[REDACTED]';\n } else if (typeof value === 'object' && value !== null) {\n (filtered as any)[key] = filterSensitiveData(value, sensitiveKeys);\n } else {\n (filtered as any)[key] = value;\n }\n }\n \n return filtered;\n}","import { \n ILogger, \n LogLevel, \n LogMessage, \n LogEntry,\n RuntimeName,\n LoggerConfig \n} from './types.ts';\nimport { detectRuntime } from '../utils/runtime.ts';\nimport { safeStringify } from '../utils/serialization.ts';\n\nexport abstract class BaseLogger implements ILogger {\n protected level: LogLevel;\n protected config: Partial<LoggerConfig>;\n protected runtime: RuntimeName;\n protected childMetadata: Record<string, any> = {};\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = config;\n this.level = config.level ?? LogLevel.INFO;\n this.runtime = detectRuntime().name;\n }\n\n debug(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.DEBUG, message, metadata);\n }\n\n info(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.INFO, message, metadata);\n }\n\n warn(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.WARN, message, metadata);\n }\n\n error(message: LogMessage, metadata?: any): void {\n this.log(LogLevel.ERROR, message, metadata);\n }\n\n log(level: LogLevel, message: LogMessage, metadata?: any): void {\n if (!this.shouldLog(level)) {\n return;\n }\n\n const resolvedMessage = typeof message === 'function' ? message() : message;\n const combinedMetadata = { ...this.childMetadata, ...metadata };\n\n const entry: LogEntry = {\n timestamp: new Date(),\n level,\n message: resolvedMessage,\n metadata: Object.keys(combinedMetadata).length > 0 ? combinedMetadata : undefined,\n runtime: this.runtime\n };\n\n this.writeLog(entry);\n }\n\n setLevel(level: LogLevel): void {\n this.level = level;\n }\n\n getLevel(): LogLevel {\n return this.level;\n }\n\n child(metadata: Record<string, any>): ILogger {\n const childLogger = this.createChild();\n childLogger.childMetadata = { ...this.childMetadata, ...metadata };\n return childLogger;\n }\n\n protected shouldLog(level: LogLevel): boolean {\n return level >= this.level;\n }\n\n protected abstract writeLog(entry: LogEntry): void;\n protected abstract createChild(): BaseLogger;\n}\n\nexport function serializeError(error: any): any {\n if (error instanceof Error) {\n return {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...(error as any) // Include any additional properties\n };\n }\n return error;\n}\n\nexport function formatLogEntry(entry: LogEntry, format: 'json' | 'text' = 'text'): string {\n if (format === 'json') {\n return safeStringify({\n timestamp: entry.timestamp.toISOString(),\n level: LogLevel[entry.level].toLowerCase(),\n message: entry.message,\n metadata: entry.metadata,\n runtime: entry.runtime\n });\n }\n\n // Text format\n const timestamp = entry.timestamp.toISOString();\n const level = LogLevel[entry.level].toUpperCase();\n const metaStr = entry.metadata ? ` ${safeStringify(entry.metadata)}` : '';\n \n return `[${timestamp}] ${level}: ${entry.message}${metaStr}`;\n}","import { BaseLogger } from '../core/logger.ts';\nimport { LogEntry, LogLevel, LoggerConfig } from '../core/types.ts';\nimport { safeStringify } from '../utils/serialization.ts';\n\nexport class NodeLogger extends BaseLogger {\n private winston?: any;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n super(config);\n this.initializeWinston();\n }\n\n private async initializeWinston(): Promise<void> {\n try {\n // Try to load Winston if available\n // @ts-ignore - Optional peer dependency\n const winston = await import('winston');\n this.winston = this.createWinstonLogger(winston);\n } catch (error) {\n // Winston not available, will fall back to console\n console.warn('[logan-logger] Winston not found, falling back to console logging');\n }\n }\n\n private createWinstonLogger(winston: any): any {\n const logFormat = winston.format.combine(\n winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),\n winston.format.errors({ stack: true }),\n winston.format.json(),\n winston.format.prettyPrint()\n );\n\n const consoleFormat = winston.format.combine(\n winston.format.colorize(),\n winston.format.timestamp({ format: 'HH:mm:ss' }),\n winston.format.printf(({ timestamp, level, message, ...meta }: any) => {\n const metaStr = Object.keys(meta).length ? JSON.stringify(meta, null, 2) : '';\n return `${timestamp} [${level}]: ${message} ${metaStr}`;\n })\n );\n\n const logger = winston.createLogger({\n level: this.getWinstonLevel(this.level),\n format: logFormat,\n transports: [\n new winston.transports.Console({\n format: process.env.NODE_ENV === 'production' ? logFormat : consoleFormat,\n }),\n ],\n });\n\n // Add file transports for production\n if (process.env.NODE_ENV === 'production') {\n logger.add(\n new winston.transports.File({\n filename: 'logs/error.log',\n level: 'error',\n maxsize: 5242880, // 5MB\n maxFiles: 5,\n })\n );\n\n logger.add(\n new winston.transports.File({\n filename: 'logs/combined.log',\n maxsize: 5242880, // 5MB\n maxFiles: 10,\n })\n );\n }\n\n return logger;\n }\n\n protected writeLog(entry: LogEntry): void {\n if (this.winston) {\n this.winston.log({\n level: this.getWinstonLevel(entry.level),\n message: entry.message,\n timestamp: entry.timestamp,\n ...entry.metadata,\n });\n } else {\n // Fallback to console\n this.writeToConsole(entry);\n }\n }\n\n protected createChild(): BaseLogger {\n return new NodeLogger(this.config);\n }\n\n private writeToConsole(entry: LogEntry): void {\n const timestamp = entry.timestamp.toISOString();\n const level = LogLevel[entry.level].toLowerCase();\n const metaStr = entry.metadata ? ` ${safeStringify(entry.metadata)}` : '';\n const message = `[${timestamp}] ${level.toUpperCase()}: ${entry.message}${metaStr}`;\n\n switch (entry.level) {\n case LogLevel.DEBUG:\n console.debug(message);\n break;\n case LogLevel.INFO:\n console.info(message);\n break;\n case LogLevel.WARN:\n console.warn(message);\n break;\n case LogLevel.ERROR:\n console.error(message);\n break;\n }\n }\n\n private getWinstonLevel(level: LogLevel): string {\n switch (level) {\n case LogLevel.DEBUG:\n return 'debug';\n case LogLevel.INFO:\n return 'info';\n case LogLevel.WARN:\n return 'warn';\n case LogLevel.ERROR:\n return 'error';\n default:\n return 'info';\n }\n }\n\n setLevel(level: LogLevel): void {\n super.setLevel(level);\n if (this.winston) {\n this.winston.level = this.getWinstonLevel(level);\n }\n }\n}\n\n// Create Morgan-compatible stream\nexport function createMorganStream(logger: NodeLogger) {\n return {\n write: (message: string) => {\n logger.info(message.trim());\n },\n };\n}","import { BaseLogger } from '../core/logger.ts';\nimport { LogEntry, LogLevel, LoggerConfig } from '../core/types.ts';\nimport { safeStringify } from '../utils/serialization.ts';\n\nexport class BrowserLogger extends BaseLogger {\n constructor(config: Partial<LoggerConfig> = {}) {\n super(config);\n }\n\n protected writeLog(entry: LogEntry): void {\n const message = this.formatMessage(entry);\n const style = this.getConsoleStyle(entry.level);\n\n // Use safeStringify for metadata to handle circular references\n const metaStr = entry.metadata ? ` ${safeStringify(entry.metadata)}` : '';\n const fullMessage = `%c${message}${metaStr}`;\n\n switch (entry.level) {\n case LogLevel.DEBUG:\n if (console.debug) {\n console.debug(fullMessage, style);\n } else {\n console.log(fullMessage, style);\n }\n break;\n case LogLevel.INFO:\n console.info(fullMessage, style);\n break;\n case LogLevel.WARN:\n console.warn(fullMessage, style);\n break;\n case LogLevel.ERROR:\n console.error(fullMessage, style);\n break;\n }\n }\n\n protected createChild(): BaseLogger {\n return new BrowserLogger(this.config);\n }\n\n private formatMessage(entry: LogEntry): string {\n const timestamp = entry.timestamp.toISOString();\n const level = LogLevel[entry.level].toUpperCase();\n return `[${timestamp}] ${level}: ${entry.message}`;\n }\n\n private getConsoleStyle(level: LogLevel): string {\n if (!this.config.colorize) {\n return '';\n }\n\n switch (level) {\n case LogLevel.DEBUG:\n return 'color: #888; font-weight: normal;';\n case LogLevel.INFO:\n return 'color: #007acc; font-weight: normal;';\n case LogLevel.WARN:\n return 'color: #ff8c00; font-weight: bold;';\n case LogLevel.ERROR:\n return 'color: #dc3545; font-weight: bold;';\n default:\n return '';\n }\n }\n\n private shouldLogInProduction(): boolean {\n // Check various environment indicators\n const env = \n (globalThis as any).process?.env?.NODE_ENV ||\n (globalThis as any).process?.env?.NEXT_PUBLIC_APP_ENV ||\n 'development';\n \n return env !== 'production' || this.level <= LogLevel.ERROR;\n }\n\n protected shouldLog(level: LogLevel): boolean {\n // In browser, respect production environment\n if (!this.shouldLogInProduction() && level < LogLevel.ERROR) {\n return false;\n }\n \n return super.shouldLog(level);\n }\n}\n\n// Browser-specific utilities\nexport class ConsoleGroupLogger extends BrowserLogger {\n private groupStack: string[] = [];\n\n group(label: string): void {\n console.group(label);\n this.groupStack.push(label);\n }\n\n groupCollapsed(label: string): void {\n console.groupCollapsed(label);\n this.groupStack.push(label);\n }\n\n groupEnd(): void {\n console.groupEnd();\n this.groupStack.pop();\n }\n\n time(label: string): void {\n console.time(label);\n }\n\n timeEnd(label: string): void {\n console.timeEnd(label);\n }\n\n trace(message: string, metadata?: any): void {\n console.trace(message, metadata);\n }\n\n count(label?: string): void {\n console.count(label);\n }\n\n countReset(label?: string): void {\n console.countReset(label);\n }\n\n table(data: any): void {\n console.table(data);\n }\n}\n\n// Performance logging for browser\nexport class PerformanceLogger extends BrowserLogger {\n mark(name: string): void {\n if (typeof performance !== 'undefined' && performance.mark) {\n performance.mark(name);\n }\n }\n\n measure(name: string, startMark?: string, endMark?: string): void {\n if (typeof performance !== 'undefined' && performance.measure) {\n try {\n performance.measure(name, startMark, endMark);\n const entries = performance.getEntriesByName(name, 'measure');\n if (entries.length > 0) {\n const entry = entries[entries.length - 1];\n this.info(`Performance: ${name}`, {\n duration: entry.duration,\n startTime: entry.startTime\n });\n }\n } catch (error) {\n this.warn('Failed to measure performance', { name, error });\n }\n }\n }\n\n clearMarks(name?: string): void {\n if (typeof performance !== 'undefined' && performance.clearMarks) {\n performance.clearMarks(name);\n }\n }\n\n clearMeasures(name?: string): void {\n if (typeof performance !== 'undefined' && performance.clearMeasures) {\n performance.clearMeasures(name);\n }\n }\n}","import { LoggerConfig, LogLevel } from '../core/types.ts';\nimport { detectRuntime } from './runtime.ts';\n\nexport function getDefaultConfig(): LoggerConfig {\n const runtime = detectRuntime();\n \n return {\n level: LogLevel.INFO,\n format: 'text',\n timestamp: true,\n colorize: runtime.capabilities.colorSupport,\n metadata: {},\n transports: [\n {\n type: 'console',\n options: {}\n }\n ]\n };\n}\n\nexport function loadConfigFromEnvironment(): Partial<LoggerConfig> {\n const config: Partial<LoggerConfig> = {};\n \n // Check for environment variables\n if (typeof process !== 'undefined' && process.env) {\n const env = process.env;\n \n // Log level\n if (env.LOG_LEVEL) {\n config.level = stringToLogLevel(env.LOG_LEVEL);\n }\n \n // Format\n if (env.LOG_FORMAT && ['json', 'text'].includes(env.LOG_FORMAT)) {\n config.format = env.LOG_FORMAT as 'json' | 'text';\n }\n \n // Timestamp\n if (env.LOG_TIMESTAMP) {\n config.timestamp = env.LOG_TIMESTAMP.toLowerCase() === 'true';\n }\n \n // Colorize\n if (env.LOG_COLOR) {\n config.colorize = env.LOG_COLOR.toLowerCase() === 'true';\n }\n }\n \n return config;\n}\n\nexport async function loadConfigFromFile(configPath?: string): Promise<Partial<LoggerConfig>> {\n const runtime = detectRuntime();\n \n if (!runtime.capabilities.fileSystem) {\n return {};\n }\n \n const possiblePaths = configPath ? [configPath] : [\n 'logan.config.json',\n 'logan.config.js',\n '.loganrc.json',\n 'package.json' // Check for logan config in package.json\n ];\n \n for (const path of possiblePaths) {\n try {\n if (runtime.name === 'node') {\n return await loadNodeConfig(path);\n } else if (runtime.name === 'deno') {\n return await loadDenoConfig(path);\n } else if (runtime.name === 'bun') {\n return await loadBunConfig(path);\n }\n } catch (error) {\n // Continue to next path\n }\n }\n \n return {};\n}\n\nasync function loadNodeConfig(path: string): Promise<Partial<LoggerConfig>> {\n try {\n const fs = await import('fs/promises');\n const pathModule = await import('path');\n \n if (path.endsWith('.json')) {\n const content = await fs.readFile(path, 'utf-8');\n const parsed = JSON.parse(content);\n \n if (path === 'package.json') {\n return parsed.logan || {};\n }\n return parsed;\n } else if (path.endsWith('.js')) {\n const fullPath = pathModule.resolve(path);\n delete require.cache[fullPath]; // Clear cache\n const config = require(fullPath);\n return config.default || config;\n }\n } catch (error) {\n // File doesn't exist or can't be parsed\n }\n \n return {};\n}\n\nasync function loadDenoConfig(path: string): Promise<Partial<LoggerConfig>> {\n try {\n if (path.endsWith('.json')) {\n const content = await (globalThis as any).Deno.readTextFile(path);\n const parsed = JSON.parse(content);\n \n if (path === 'package.json') {\n return parsed.logan || {};\n }\n return parsed;\n } else if (path.endsWith('.js')) {\n const config = await import(/* @vite-ignore */ `./${path}`);\n return config.default || config;\n }\n } catch (error) {\n // File doesn't exist or can't be parsed\n }\n \n return {};\n}\n\nasync function loadBunConfig(path: string): Promise<Partial<LoggerConfig>> {\n // Bun can use Node.js-style require or ES modules\n return loadNodeConfig(path);\n}\n\nfunction stringToLogLevel(level: string): LogLevel {\n switch (level.toLowerCase()) {\n case 'debug':\n return LogLevel.DEBUG;\n case 'info':\n return LogLevel.INFO;\n case 'warn':\n case 'warning':\n return LogLevel.WARN;\n case 'error':\n return LogLevel.ERROR;\n case 'silent':\n case 'none':\n return LogLevel.SILENT;\n default:\n return LogLevel.INFO;\n }\n}\n\nexport function mergeConfigs(...configs: Partial<LoggerConfig>[]): LoggerConfig {\n const defaultConfig = getDefaultConfig();\n \n return configs.reduce<LoggerConfig>((merged, config) => ({\n ...merged,\n ...config,\n metadata: {\n ...merged.metadata,\n ...config.metadata\n },\n transports: config.transports || merged.transports\n }), defaultConfig);\n}","import { ILogger, LoggerConfig, LogLevel } from './types.ts';\nimport { detectRuntime } from '../utils/runtime.ts';\nimport { NodeLogger } from '../runtime/node.ts';\nimport { BrowserLogger } from '../runtime/browser.ts';\nimport { getDefaultConfig } from '../utils/config.ts';\n\n/**\n * Factory class for creating logger instances based on the detected runtime.\n */\nexport class LoggerFactory {\n /**\n * Create a logger instance appropriate for the current runtime.\n * @param config - Optional configuration for the logger\n * @returns A logger instance\n */\n static create(config: Partial<LoggerConfig> = {}): ILogger {\n const runtime = detectRuntime();\n const mergedConfig = this.mergeConfig(config);\n\n switch (runtime.name) {\n case 'node':\n return new NodeLogger(mergedConfig);\n \n case 'deno':\n // For now, use console-based logger for Deno\n // TODO: Implement Deno-specific logger\n return new BrowserLogger(mergedConfig);\n \n case 'bun':\n // For now, use Node.js logger for Bun (similar APIs)\n return new NodeLogger(mergedConfig);\n \n case 'browser':\n case 'webworker':\n return new BrowserLogger(mergedConfig);\n \n default:\n // Fallback to console-based logger\n return new BrowserLogger(mergedConfig);\n }\n }\n\n /**\n * Create a child logger with additional metadata.\n * @param parent - The parent logger instance\n * @param metadata - Additional metadata to include in all child log messages\n * @returns A new logger instance with the additional metadata\n */\n static createChild(parent: ILogger, metadata: Record<string, any>): ILogger {\n return parent.child(metadata);\n }\n\n private static mergeConfig(userConfig: Partial<LoggerConfig>): Partial<LoggerConfig> {\n const defaultConfig = getDefaultConfig();\n return {\n ...defaultConfig,\n ...userConfig,\n metadata: {\n ...defaultConfig.metadata,\n ...userConfig.metadata\n }\n };\n }\n}\n\n/**\n * Convenience function for creating a logger instance.\n * @param config - Optional configuration for the logger\n * @returns A logger instance appropriate for the current runtime\n * @example\n * ```typescript\n * import { createLogger, LogLevel } from 'logan-logger';\n * \n * const logger = createLogger({\n * level: LogLevel.DEBUG,\n * colorize: true\n * });\n * \n * logger.info('Hello world!');\n * ```\n */\nexport function createLogger(config?: Partial<LoggerConfig>): ILogger {\n return LoggerFactory.create(config);\n}\n\n/**\n * Create a logger with configuration based on the current environment.\n * Automatically detects production/development/test environments and\n * sets appropriate log levels and formatting.\n * @returns A logger instance configured for the current environment\n */\nexport function createLoggerForEnvironment(): ILogger {\n const env = getEnvironment();\n \n const config: Partial<LoggerConfig> = {\n level: getLogLevelForEnvironment(env),\n colorize: env !== 'production',\n timestamp: true,\n format: env === 'production' ? 'json' : 'text'\n };\n\n return createLogger(config);\n}\n\nfunction getEnvironment(): string {\n // Check various environment variables\n if (typeof process !== 'undefined' && process.env) {\n return process.env.NODE_ENV || \n process.env.NEXT_PUBLIC_APP_ENV || \n process.env.ENVIRONMENT || \n 'development';\n }\n \n // Browser environment detection\n if (typeof window !== 'undefined') {\n // Check for common build-time environment indicators\n return (globalThis as any).__ENV__ || 'development';\n }\n \n return 'development';\n}\n\nfunction getLogLevelForEnvironment(env: string): LogLevel {\n switch (env) {\n case 'production':\n return LogLevel.ERROR;\n case 'staging':\n case 'test':\n return LogLevel.WARN;\n case 'development':\n case 'dev':\n return LogLevel.DEBUG;\n default:\n return LogLevel.INFO;\n }\n}\n\n// Type-safe log level conversion\nexport function stringToLogLevel(level: string): LogLevel {\n switch (level.toLowerCase()) {\n case 'debug':\n return LogLevel.DEBUG;\n case 'info':\n return LogLevel.INFO;\n case 'warn':\n case 'warning':\n return LogLevel.WARN;\n case 'error':\n return LogLevel.ERROR;\n case 'silent':\n case 'none':\n return LogLevel.SILENT;\n default:\n return LogLevel.INFO;\n }\n}\n\nexport function logLevelToString(level: LogLevel): string {\n switch (level) {\n case LogLevel.DEBUG:\n return 'debug';\n case LogLevel.INFO:\n return 'info';\n case LogLevel.WARN:\n return 'warn';\n case LogLevel.ERROR:\n return 'error';\n case LogLevel.SILENT:\n return 'silent';\n default:\n return 'info';\n }\n}","// Main entry point for logan-logger\nexport * from './core/types.ts';\nexport * from './core/logger.ts';\nexport * from './core/factory.ts';\n\n// Runtime-specific exports\nexport { NodeLogger, createMorganStream } from './runtime/node.ts';\nexport { BrowserLogger, ConsoleGroupLogger, PerformanceLogger } from './runtime/browser.ts';\n\n// Utilities\nexport * from './utils/runtime.ts';\nexport * from './utils/config.ts';\nexport * from './utils/serialization.ts';\n\n// Main factory function (available as named export)\n\n// Convenience exports for common use cases\nimport { createLogger, createLoggerForEnvironment } from './core/factory.ts';\nimport { LogLevel, ILogger } from './core/types.ts';\n\n// Pre-configured loggers for different environments\nexport const logger: ILogger = createLoggerForEnvironment();\n\n// Legacy compatibility - matches your existing client/server code\nexport const log = {\n debug: (message: string, meta?: any): void => logger.debug(message, meta),\n info: (message: string, meta?: any): void => logger.info(message, meta),\n warn: (message: string, meta?: any): void => logger.warn(message, meta),\n error: (message: string, meta?: any): void => logger.error(message, meta),\n};\n\n// Named exports for explicit imports\nexport {\n createLogger,\n createLoggerForEnvironment,\n LogLevel\n};\n\n// Type-only exports for better tree-shaking\nexport type {\n ILogger,\n LoggerConfig,\n RuntimeInfo,\n RuntimeCapabilities,\n LogEntry,\n LogMessage,\n LogLevelString,\n RuntimeName,\n TransportConfig,\n ILoggerAdapter\n} from './core/types.ts';"],"names":["LogLevel","detectRuntime","name","detectRuntimeName","version","getRuntimeVersion","capabilities","getRuntimeCapabilities","runtime","isNode","isBrowser","isDeno","isBun","safeStringify","obj","space","seen","key","value","acc","prop","filterSensitiveData","sensitiveKeys","filtered","sensitiveKey","BaseLogger","config","message","metadata","level","resolvedMessage","combinedMetadata","entry","childLogger","serializeError","error","formatLogEntry","format","timestamp","metaStr","NodeLogger","winston","logFormat","consoleFormat","meta","logger","createMorganStream","BrowserLogger","style","fullMessage","ConsoleGroupLogger","label","data","PerformanceLogger","startMark","endMark","entries","getDefaultConfig","loadConfigFromEnvironment","env","stringToLogLevel","loadConfigFromFile","configPath","possiblePaths","path","loadNodeConfig","loadDenoConfig","loadBunConfig","fs","pathModule","content","parsed","fullPath","mergeConfigs","configs","defaultConfig","merged","LoggerFactory","mergedConfig","parent","userConfig","createLogger","createLoggerForEnvironment","getEnvironment","getLogLevelForEnvironment","logLevelToString","log"],"mappings":"2hBAIO,IAAKA,GAAAA,IAEVA,EAAAA,EAAA,MAAQ,CAAA,EAAR,QAEAA,EAAAA,EAAA,KAAO,CAAA,EAAP,OAEAA,EAAAA,EAAA,KAAO,CAAA,EAAP,OAEAA,EAAAA,EAAA,MAAQ,CAAA,EAAR,QAEAA,EAAAA,EAAA,OAAS,CAAA,EAAT,SAVUA,IAAAA,GAAA,CAAA,CAAA,ECOL,SAASC,GAA6B,CAC3C,MAAMC,EAAOC,EAAA,EACPC,EAAUC,EAAkBH,CAAI,EAChCI,EAAeC,EAAuBL,CAAI,EAEhD,MAAO,CACL,KAAAA,EACA,QAAAE,EACA,aAAAE,CAAA,CAEJ,CAEA,SAASH,GAAiC,CAExC,OAAI,OAAQ,WAAmB,KAAS,IAC/B,OAIL,OAAQ,WAAmB,IAAQ,IAC9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Z,MAAO,QACT,KAAKA,EAAS,KACZ,MAAO,OACT,KAAKA,EAAS,KACZ,MAAO,OACT,KAAKA,EAAS,MACZ,MAAO,QACT,KAAKA,EAAS,OACZ,MAAO,SACT,QACE,MAAO,MAAA,CAEb,CCvJO,MAAM6C,EAAkBqC,EAAA,EAGlBI,EAAM,CACjB,MAAO,CAAC3D,EAAiBiB,IAAqBC,EAAO,MAAMlB,EAASiB,CAAI,EACxE,KAAM,CAACjB,EAAiBiB,IAAqBC,EAAO,KAAKlB,EAASiB,CAAI,EACtE,KAAM,CAACjB,EAAiBiB,IAAqBC,EAAO,KAAKlB,EAASiB,CAAI,EACtE,MAAO,CAACjB,EAAiBiB,IAAqBC,EAAO,MAAMlB,EAASiB,CAAI,CAC1E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "logan-logger",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Universal TypeScript logging library for all JavaScript runtimes",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "pnpm build:clean && pnpm build:lib",
|
|
17
|
+
"build:clean": "rm -rf dist",
|
|
18
|
+
"build:lib": "vite build",
|
|
19
|
+
"dev": "bun run src/index.ts",
|
|
20
|
+
"test": "vitest run --reporter=default",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"test:ui": "vitest --ui",
|
|
23
|
+
"test:coverage": "vitest run --coverage",
|
|
24
|
+
"lint": "eslint src --ext .ts",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"publish:jsr": "deno publish"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"logging",
|
|
30
|
+
"logger",
|
|
31
|
+
"typescript",
|
|
32
|
+
"universal",
|
|
33
|
+
"node",
|
|
34
|
+
"deno",
|
|
35
|
+
"bun",
|
|
36
|
+
"browser",
|
|
37
|
+
"winston"
|
|
38
|
+
],
|
|
39
|
+
"author": "Logan Lindquist Land",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^20.0.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
44
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
45
|
+
"@vitest/ui": "^3.0.0",
|
|
46
|
+
"eslint": "^8.0.0",
|
|
47
|
+
"typescript": "^5.0.0",
|
|
48
|
+
"vite": "^6.0.0",
|
|
49
|
+
"vite-plugin-dts": "^4.0.0",
|
|
50
|
+
"vitest": "^3.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"winston": "^3.8.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"winston": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=20.0.0"
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"dist",
|
|
65
|
+
"README.md",
|
|
66
|
+
"LICENSE"
|
|
67
|
+
],
|
|
68
|
+
"pnpm": {
|
|
69
|
+
"overrides": {
|
|
70
|
+
"esbuild": ">=0.25.0"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|