@mks2508/better-logger 0.0.1 â 0.0.2-alpha.2
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/.claude/settings.local.json +10 -1
- package/.github/workflows/ci.yml +319 -0
- package/.github/workflows/release.yml +269 -0
- package/.npmrc.bak +1 -0
- package/README.md +577 -0
- package/demo.html +840 -0
- package/dist/chunks/Logger-BQhMKy_T.js +2 -0
- package/dist/chunks/Logger-BQhMKy_T.js.map +1 -0
- package/dist/chunks/Logger-BrFKFZcD.js +978 -0
- package/dist/chunks/Logger-BrFKFZcD.js.map +1 -0
- package/dist/chunks/core-2opW4Pi3.js +194 -0
- package/dist/chunks/core-2opW4Pi3.js.map +1 -0
- package/dist/chunks/core-DyugwSYZ.js +4 -0
- package/dist/chunks/core-DyugwSYZ.js.map +1 -0
- package/dist/chunks/exports-BNP3R7dp.js +421 -0
- package/dist/chunks/exports-BNP3R7dp.js.map +1 -0
- package/dist/chunks/exports-U1xLBXrY.js +2 -0
- package/dist/chunks/exports-U1xLBXrY.js.map +1 -0
- package/dist/chunks/styling-DhUDzwlE.js +654 -0
- package/dist/chunks/styling-DhUDzwlE.js.map +1 -0
- package/dist/chunks/styling-tmRDI28D.js +2 -0
- package/dist/chunks/styling-tmRDI28D.js.map +1 -0
- package/dist/core.cjs +2 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.js +244 -0
- package/dist/core.js.map +1 -0
- package/dist/exports.cjs +2 -0
- package/dist/exports.cjs.map +1 -0
- package/dist/exports.js +237 -0
- package/dist/exports.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/styling.cjs +2 -0
- package/dist/styling.cjs.map +1 -0
- package/dist/styling.js +146 -0
- package/dist/styling.js.map +1 -0
- package/dist/types/core.d.ts +211 -0
- package/dist/types/exports.d.ts +600 -0
- package/dist/types/index.d.ts +675 -0
- package/dist/types/styling.d.ts +751 -0
- package/docs/CORE.md +264 -0
- package/docs/EXPORTS.md +467 -0
- package/docs/STYLING.md +405 -0
- package/index.html +28 -4
- package/package.json +37 -4
- package/src/Logger.ts +28 -8
- package/src/cli/CommandProcessor.ts +2 -2
- package/src/cli/commands/ExportCommand.ts +5 -0
- package/src/cli/commands/StatusCommand.ts +11 -10
- package/src/core.ts +320 -0
- package/src/example.ts +184 -62
- package/src/exports-module.ts +311 -0
- package/src/handlers/ExportLogHandler.ts +34 -13
- package/src/index.ts +97 -79
- package/src/main.ts +77 -7
- package/src/styling-module.ts +244 -0
- package/src/utils/stackTrace.ts +39 -10
- package/src/utils/timestamps.ts +1 -1
- package/tsconfig.json +40 -14
- package/vite.config.ts +84 -0
- package/dist/assets/index-DxvJByYN.js +0 -183
- package/dist/index.html +0 -334
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styling-DhUDzwlE.js","sources":["../../src/styling/StyleBuilder.ts","../../src/styling/themes.ts","../../src/styling/banners.ts"],"sourcesContent":["/**\n * @fileoverview StyleBuilder class for Advanced Logger\n */\n\n/**\n * Utility class for creating dynamic console styles with method chaining\n */\nexport class StyleBuilder {\n private styles: string[] = [];\n\n constructor(baseStyle = '') {\n if (baseStyle) this.styles.push(baseStyle);\n }\n\n /**\n * Add background color or gradient\n */\n bg(background: string): StyleBuilder {\n this.styles.push(`background: ${background}`);\n return this;\n }\n\n /**\n * Add text color\n */\n color(color: string): StyleBuilder {\n this.styles.push(`color: ${color}`);\n return this;\n }\n\n /**\n * Add border styling\n */\n border(border: string): StyleBuilder {\n this.styles.push(`border: ${border}`);\n return this;\n }\n\n /**\n * Add box shadow\n */\n shadow(shadow: string): StyleBuilder {\n this.styles.push(`box-shadow: ${shadow}`);\n return this;\n }\n\n /**\n * Add padding\n */\n padding(padding: string): StyleBuilder {\n this.styles.push(`padding: ${padding}`);\n return this;\n }\n\n /**\n * Add margin\n */\n margin(margin: string): StyleBuilder {\n this.styles.push(`margin: ${margin}`);\n return this;\n }\n\n /**\n * Add border radius\n */\n rounded(radius: string = '4px'): StyleBuilder {\n this.styles.push(`border-radius: ${radius}`);\n return this;\n }\n\n /**\n * Add font weight\n */\n bold(): StyleBuilder {\n this.styles.push('font-weight: bold');\n return this;\n }\n\n /**\n * Add font styling\n */\n font(font: string): StyleBuilder {\n this.styles.push(`font-family: ${font}`);\n return this;\n }\n\n /**\n * Add font size\n */\n size(size: string): StyleBuilder {\n this.styles.push(`font-size: ${size}`);\n return this;\n }\n\n /**\n * Add line height\n */\n lineHeight(height: string): StyleBuilder {\n this.styles.push(`line-height: ${height}`);\n return this;\n }\n\n /**\n * Add text decoration\n */\n underline(): StyleBuilder {\n this.styles.push('text-decoration: underline');\n return this;\n }\n\n /**\n * Add text transform\n */\n uppercase(): StyleBuilder {\n this.styles.push('text-transform: uppercase');\n return this;\n }\n\n /**\n * Add opacity\n */\n opacity(value: number): StyleBuilder {\n this.styles.push(`opacity: ${value}`);\n return this;\n }\n\n /**\n * Add display property\n */\n display(value: string): StyleBuilder {\n this.styles.push(`display: ${value}`);\n return this;\n }\n\n /**\n * Add position property\n */\n position(value: string): StyleBuilder {\n this.styles.push(`position: ${value}`);\n return this;\n }\n\n /**\n * Add transform property\n */\n transform(value: string): StyleBuilder {\n this.styles.push(`transform: ${value}`);\n return this;\n }\n\n /**\n * Add animation property\n */\n animation(value: string): StyleBuilder {\n this.styles.push(`animation: ${value}`);\n return this;\n }\n\n /**\n * Add transition property\n */\n transition(value: string): StyleBuilder {\n this.styles.push(`transition: ${value}`);\n return this;\n }\n\n /**\n * Add cursor property\n */\n cursor(value: string): StyleBuilder {\n this.styles.push(`cursor: ${value}`);\n return this;\n }\n\n /**\n * Add any custom CSS property\n */\n custom(property: string, value: string): StyleBuilder {\n this.styles.push(`${property}: ${value}`);\n return this;\n }\n\n /**\n * Add any CSS property (alias for custom)\n */\n css(property: string, value: string): StyleBuilder {\n return this.custom(property, value);\n }\n\n /**\n * Build the final CSS string\n */\n build(): string {\n return this.styles.join('; ');\n }\n\n /**\n * Clear all styles and start fresh\n */\n clear(): StyleBuilder {\n this.styles = [];\n return this;\n }\n\n /**\n * Clone this StyleBuilder with the same styles\n */\n clone(): StyleBuilder {\n const cloned = new StyleBuilder();\n cloned.styles = [...this.styles];\n return cloned;\n }\n\n /**\n * Merge another StyleBuilder's styles into this one\n */\n merge(other: StyleBuilder): StyleBuilder {\n this.styles.push(...other.styles);\n return this;\n }\n}\n\n/**\n * Proxy-based dynamic styler for chainable console styling\n */\nfunction createStyler(): any {\n const builder = new StyleBuilder();\n return new Proxy(builder, {\n get(target: StyleBuilder, prop: string) {\n if (prop in target) {\n const method = (target as any)[prop];\n if (typeof method === 'function') {\n return method.bind(target);\n }\n return method;\n }\n return undefined;\n }\n });\n}\n\n/**\n * Dynamic styler instance for external use\n */\nexport const $ = createStyler();\n\n/**\n * Pre-defined style presets for common use cases\n */\nexport const StylePresets = {\n success: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #00b894 0%, #00a085 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n error: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #e84393 0%, #d63031 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n warning: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)')\n .color('#2d3436')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n info: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n debug: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #667eea 0%, #764ba2 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n muted: () => new StyleBuilder()\n .color('#6c757d')\n .font('Monaco, Consolas, monospace')\n .size('12px'),\n\n accent: () => new StyleBuilder()\n .bg('#f8f9fa')\n .color('#495057')\n .padding('2px 6px')\n .rounded('3px')\n .border('1px solid #dee2e6'),\n\n neon: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #0f3460 0%, #e94560 100%)')\n .color('#00ffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold()\n .shadow('0 0 10px rgba(0, 255, 255, 0.5)'),\n};","/**\n * @fileoverview Theme presets for Advanced Logger\n */\n\nimport type { ThemeVariant } from '../types/index.js';\nimport type { LevelStyleConfig } from '../utils/index.js';\n\n/**\n * Theme configurations for different visual styles\n */\nexport const THEME_PRESETS: Record<ThemeVariant, Record<string, LevelStyleConfig>> = {\n default: {\n debug: {\n emoji: 'đ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n color: '#ffffff', border: '1px solid #667eea',\n shadow: '0 2px 4px rgba(102, 126, 234, 0.3)',\n },\n info: {\n emoji: 'âšī¸', label: 'INFO',\n background: 'linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)',\n color: '#ffffff', border: '1px solid #74b9ff',\n shadow: '0 2px 4px rgba(116, 185, 255, 0.3)',\n },\n warn: {\n emoji: 'â ī¸', label: 'WARN',\n background: 'linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)',\n color: '#2d3436', border: '1px solid #fdcb6e',\n shadow: '0 2px 4px rgba(253, 203, 110, 0.3)',\n },\n error: {\n emoji: 'â', label: 'ERROR',\n background: 'linear-gradient(135deg, #e84393 0%, #d63031 100%)',\n color: '#ffffff', border: '1px solid #e84393',\n shadow: '0 2px 4px rgba(232, 67, 147, 0.3)',\n },\n success: {\n emoji: 'â
', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #00b894 0%, #00a085 100%)',\n color: '#ffffff', border: '1px solid #00b894',\n shadow: '0 2px 4px rgba(0, 184, 148, 0.3)',\n },\n critical: {\n emoji: 'đĨ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #ff3838 0%, #ff1744 100%)',\n color: '#ffffff', border: '2px solid #ff3838',\n shadow: '0 4px 8px rgba(255, 56, 56, 0.5)',\n },\n },\n dark: {\n debug: {\n emoji: 'đ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #2d3748 0%, #4a5568 100%)',\n color: '#e2e8f0', border: '1px solid #4a5568',\n shadow: '0 2px 4px rgba(45, 55, 72, 0.8)',\n },\n info: {\n emoji: 'đĄ', label: 'INFO',\n background: 'linear-gradient(135deg, #1a202c 0%, #2d3748 100%)',\n color: '#90cdf4', border: '1px solid #3182ce',\n shadow: '0 2px 4px rgba(26, 32, 44, 0.8)',\n },\n warn: {\n emoji: 'âĄ', label: 'WARN',\n background: 'linear-gradient(135deg, #744210 0%, #975a16 100%)',\n color: '#faf089', border: '1px solid #d69e2e',\n shadow: '0 2px 4px rgba(116, 66, 16, 0.8)',\n },\n error: {\n emoji: 'đ', label: 'ERROR',\n background: 'linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)',\n color: '#feb2b2', border: '1px solid #e53e3e',\n shadow: '0 2px 4px rgba(116, 42, 42, 0.8)',\n },\n success: {\n emoji: 'đ¯', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #276749 0%, #2f855a 100%)',\n color: '#9ae6b4', border: '1px solid #38a169',\n shadow: '0 2px 4px rgba(39, 103, 73, 0.8)',\n },\n critical: {\n emoji: 'đĨ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)',\n color: '#ffffff', border: '2px solid #ff0000',\n shadow: '0 4px 8px rgba(255, 0, 0, 0.9)',\n },\n },\n neon: {\n debug: {\n emoji: 'âĄ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0f3460 0%, #e94560 100%)',\n color: '#00ffff', border: '1px solid #00ffff',\n shadow: '0 0 10px rgba(0, 255, 255, 0.5)',\n },\n info: {\n emoji: 'đŽ', label: 'INFO',\n background: 'linear-gradient(135deg, #16213e 0%, #0f3460 100%)',\n color: '#00ff41', border: '1px solid #00ff41',\n shadow: '0 0 10px rgba(0, 255, 65, 0.5)',\n },\n warn: {\n emoji: 'â ī¸', label: 'WARN',\n background: 'linear-gradient(135deg, #533a03 0%, #e94560 100%)',\n color: '#ffff00', border: '1px solid #ffff00',\n shadow: '0 0 10px rgba(255, 255, 0, 0.5)',\n },\n error: {\n emoji: 'đĨ', label: 'ERROR',\n background: 'linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)',\n color: '#ff073a', border: '1px solid #ff073a',\n shadow: '0 0 10px rgba(255, 7, 58, 0.8)',\n },\n success: {\n emoji: 'â¨', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)',\n color: '#39ff14', border: '1px solid #39ff14',\n shadow: '0 0 10px rgba(57, 255, 20, 0.8)',\n },\n critical: {\n emoji: 'đ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0080 100%)',\n color: '#ff0080', border: '2px solid #ff0080',\n shadow: '0 0 20px rgba(255, 0, 128, 1)',\n },\n },\n minimal: {\n debug: {\n emoji: '', label: 'DEBUG',\n background: '#f7fafc', color: '#4a5568',\n border: '1px solid #e2e8f0', shadow: 'none',\n },\n info: {\n emoji: '', label: 'INFO',\n background: '#ebf8ff', color: '#2b6cb0',\n border: '1px solid #bee3f8', shadow: 'none',\n },\n warn: {\n emoji: '', label: 'WARN',\n background: '#fffbf0', color: '#c05621',\n border: '1px solid #fed7aa', shadow: 'none',\n },\n error: {\n emoji: '', label: 'ERROR',\n background: '#fef5f5', color: '#c53030',\n border: '1px solid #fca5a5', shadow: 'none',\n },\n success: {\n emoji: '', label: 'SUCCESS',\n background: '#f0fff4', color: '#2f855a',\n border: '1px solid #9ae6b4', shadow: 'none',\n },\n critical: {\n emoji: '', label: 'CRITICAL',\n background: '#fef5f5', color: '#e53e3e',\n border: '2px solid #f56565', shadow: 'none',\n },\n },\n // Additional theme variants can be added here\n light: {\n debug: {\n emoji: 'đ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)',\n color: '#1565c0', border: '1px solid #90caf9',\n shadow: '0 1px 3px rgba(33, 150, 243, 0.2)',\n },\n info: {\n emoji: 'âšī¸', label: 'INFO',\n background: 'linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)',\n color: '#7b1fa2', border: '1px solid #ce93d8',\n shadow: '0 1px 3px rgba(156, 39, 176, 0.2)',\n },\n warn: {\n emoji: 'â ī¸', label: 'WARN',\n background: 'linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)',\n color: '#f57c00', border: '1px solid #ffcc02',\n shadow: '0 1px 3px rgba(255, 152, 0, 0.2)',\n },\n error: {\n emoji: 'â', label: 'ERROR',\n background: 'linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)',\n color: '#d32f2f', border: '1px solid #f44336',\n shadow: '0 1px 3px rgba(244, 67, 54, 0.2)',\n },\n success: {\n emoji: 'â
', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)',\n color: '#388e3c', border: '1px solid #4caf50',\n shadow: '0 1px 3px rgba(76, 175, 80, 0.2)',\n },\n critical: {\n emoji: 'đ¨', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)',\n color: '#c2185b', border: '2px solid #e91e63',\n shadow: '0 2px 6px rgba(233, 30, 99, 0.3)',\n },\n },\n cyberpunk: {\n debug: {\n emoji: 'đ¤', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)',\n color: '#00d4aa', border: '1px solid #00d4aa',\n shadow: '0 0 15px rgba(0, 212, 170, 0.4)',\n },\n info: {\n emoji: 'đ', label: 'INFO',\n background: 'linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)',\n color: '#00b4d8', border: '1px solid #00b4d8',\n shadow: '0 0 15px rgba(0, 180, 216, 0.4)',\n },\n warn: {\n emoji: 'âĄ', label: 'WARN',\n background: 'linear-gradient(135deg, #f72585 0%, #b5179e 100%)',\n color: '#ffff3f', border: '1px solid #ffff3f',\n shadow: '0 0 15px rgba(255, 255, 63, 0.4)',\n },\n error: {\n emoji: 'đ', label: 'ERROR',\n background: 'linear-gradient(135deg, #7209b7 0%, #480ca8 100%)',\n color: '#ff006e', border: '1px solid #ff006e',\n shadow: '0 0 15px rgba(255, 0, 110, 0.6)',\n },\n success: {\n emoji: 'âĄ', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #003566 0%, #001d3d 100%)',\n color: '#00f5ff', border: '1px solid #00f5ff',\n shadow: '0 0 15px rgba(0, 245, 255, 0.4)',\n },\n critical: {\n emoji: 'đĨ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0040 100%)',\n color: '#ff0040', border: '2px solid #ff0040',\n shadow: '0 0 25px rgba(255, 0, 64, 0.8)',\n },\n },\n};","/**\n * @fileoverview Banner configurations for Advanced Logger\n */\n\nimport type { BannerType, ThemeVariant } from '../types/index.js';\n\n/**\n * Banner variants for different display capabilities\n */\nexport const BANNER_VARIANTS = {\n simple: {\n text: 'đ ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling đ',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;'\n },\n ascii: {\n text: `\n ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____ \n / _ \\\\ / __ \\\\| | / / / _ \\\\ | \\\\ | |/ ____| ____| _ \\\\ | | / _ \\\\ / ____| ___| _ | _ \\\\ \n / /_\\\\ \\\\ / / _\\` | |/ / / /_\\\\ \\\\ | \\\\| | | | |__ | | | | | | / / \\\\ \\\\| | __| |_ | |_| | |_) |\n | _ || | (_| | < | _ | | . \\` | | | __| | | | | | | | | | | | |_ | _| | /| _ < \n | | | |\\\\ \\\\__,_|_|\\\\_\\\\ | | | | | |\\\\ | |___| |____| |_| | | |__\\\\ \\\\_/ /| |__| | |___| |\\\\ \\\\| |_) |\n \\\\_| |_/ \\\\____/ \\\\_| |_/ |_| \\\\_|\\\\_____|______|____/ |_____/\\\\___/ \\\\_____|_____|_| \\\\_|____/\n\n Advanced Logger v2.0.0 - Console Excellence`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'\n },\n unicode: {\n text: `\nââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ\nâ đ ADVANCED LOGGER v2.0.0 â\nâ State-of-the-art Console Styling â \nââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'\n },\n svg: {\n text: ' ',\n style: `\n background-image: url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>đ ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>\");\n background-repeat: no-repeat;\n background-size: 400px 80px;\n padding: 40px 200px;\n color: transparent;\n display: inline-block;\n border-radius: 8px;\n `\n },\n animated: {\n text: ' đ ADVANCED LOGGER v2.0.0 ',\n style: `\n background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);\n background-size: 400% 400%;\n color: white;\n padding: 15px 25px;\n border-radius: 10px;\n font-weight: bold;\n font-size: 14px;\n font-family: monospace;\n animation: gradientShift 3s ease infinite;\n display: inline-block;\n `\n }\n};\n\n/**\n * Theme-specific banners for enhanced visual theming\n */\nexport const THEME_BANNERS: Record<ThemeVariant, { simple: string; style: string }> = {\n default: {\n simple: 'đ ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling đ',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;'\n },\n dark: {\n simple: 'đ ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence đ',\n style: 'background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;'\n },\n neon: {\n simple: '⥠ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience âĄ',\n style: 'background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;'\n },\n minimal: {\n simple: 'ADVANCED LOGGER v2.0.0 - Clean Console Styling',\n style: 'background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;'\n },\n light: {\n simple: 'âī¸ ADVANCED LOGGER v2.0.0 - Bright Console Styling âī¸',\n style: 'background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;'\n },\n cyberpunk: {\n simple: 'đ¤ ADVANCED LOGGER v2.0.0 - Neural Console Interface đ¤',\n style: 'background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;'\n }\n};\n\n/**\n * Feature detection for banner capabilities\n */\nexport function detectBannerCapabilities(): BannerType {\n // Try to detect browser capabilities\n const userAgent = navigator.userAgent;\n const isChrome = /Chrome/.test(userAgent);\n const isFirefox = /Firefox/.test(userAgent);\n const isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);\n \n // Check for SVG support (most modern browsers)\n const supportsSVG = !!document.createElementNS && \n !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;\n \n // Check for CSS animation support\n const supportsAnimations = typeof document !== 'undefined' && \n 'animationName' in document.createElement('div').style;\n \n // Progressive enhancement\n if (supportsAnimations && isChrome) {\n return 'animated';\n } else if (supportsSVG && (isChrome || isFirefox)) {\n return 'svg';\n } else if (isChrome || isFirefox) {\n return 'unicode';\n } else if (isSafari) {\n return 'ascii';\n }\n \n return 'simple';\n}\n\n/**\n * Display initialization banner with advanced styling\n */\nexport function displayInitBanner(bannerType?: BannerType): void {\n const selectedType = bannerType || detectBannerCapabilities();\n const banner = BANNER_VARIANTS[selectedType];\n \n // Add CSS animation keyframes if needed\n if (selectedType === 'animated') {\n const style = document.createElement('style');\n style.textContent = `\n @keyframes gradientShift {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n `;\n document.head.appendChild(style);\n }\n \n console.log(`%c${banner.text}`, banner.style);\n\n // Show feature highlights\n const features = [\n 'đ¨ Advanced CSS Console Styling',\n 'đ Automatic Stack Trace Parsing',\n 'đ§ Scoped Loggers & Prefixes',\n '⥠Performance Timers',\n 'đ¯ Verbosity Filtering',\n 'đ Extensible Handlers',\n 'đą Modern TypeScript Patterns',\n 'đ¤ Export & Clipboard Support'\n ];\n\n console.group(`%c⨠Features`, 'background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;');\n\n features.forEach(feature => {\n console.log(`%c${feature}`, 'color: #6c757d; font-size: 13px;');\n });\n\n console.groupEnd();\n console.log(''); // Add spacing\n}"],"names":[],"mappings":"AAOO,MAAM,aAAa;AAAA,EACd,SAAmB,CAAA;AAAA,EAE3B,YAAY,YAAY,IAAI;AACxB,QAAI,UAAW,MAAK,OAAO,KAAK,SAAS;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EA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AAA;AAAA;AAAA;AAAA;AAAA;AAOpB,aAAS,KAAK,YAAY,KAAK;AAAA,EACnC;AAEA,UAAQ,IAAI,KAAK,OAAO,IAAI,IAAI,OAAO,KAAK;AAG5C,QAAM,WAAW;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGJ,UAAQ,MAAM,gBAAgB,+FAA+F;AAE7H,WAAS,QAAQ,CAAA,YAAW;AACxB,YAAQ,IAAI,KAAK,OAAO,IAAI,kCAAkC;AAAA,EAClE,CAAC;AAED,UAAQ,SAAA;AACR,UAAQ,IAAI,EAAE;AAClB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";class StyleBuilder{styles=[];constructor(e=""){e&&this.styles.push(e)}bg(e){return this.styles.push(`background: ${e}`),this}color(e){return this.styles.push(`color: ${e}`),this}border(e){return this.styles.push(`border: ${e}`),this}shadow(e){return this.styles.push(`box-shadow: ${e}`),this}padding(e){return this.styles.push(`padding: ${e}`),this}margin(e){return this.styles.push(`margin: ${e}`),this}rounded(e="4px"){return this.styles.push(`border-radius: ${e}`),this}bold(){return this.styles.push("font-weight: bold"),this}font(e){return this.styles.push(`font-family: ${e}`),this}size(e){return this.styles.push(`font-size: ${e}`),this}lineHeight(e){return this.styles.push(`line-height: ${e}`),this}underline(){return this.styles.push("text-decoration: underline"),this}uppercase(){return this.styles.push("text-transform: uppercase"),this}opacity(e){return this.styles.push(`opacity: ${e}`),this}display(e){return this.styles.push(`display: ${e}`),this}position(e){return this.styles.push(`position: ${e}`),this}transform(e){return this.styles.push(`transform: ${e}`),this}animation(e){return this.styles.push(`animation: ${e}`),this}transition(e){return this.styles.push(`transition: ${e}`),this}cursor(e){return this.styles.push(`cursor: ${e}`),this}custom(e,o){return this.styles.push(`${e}: ${o}`),this}css(e,o){return this.custom(e,o)}build(){return this.styles.join("; ")}clear(){return this.styles=[],this}clone(){const e=new StyleBuilder;return e.styles=[...this.styles],e}merge(e){return this.styles.push(...e.styles),this}}!function(){const e=new StyleBuilder;new Proxy(e,{get(e,o){if(o in e){const r=e[o];return"function"==typeof r?r.bind(e):r}}})}();const e={success:()=>(new StyleBuilder).bg("linear-gradient(135deg, #00b894 0%, #00a085 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),error:()=>(new StyleBuilder).bg("linear-gradient(135deg, #e84393 0%, #d63031 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),warning:()=>(new StyleBuilder).bg("linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)").color("#2d3436").padding("4px 8px").rounded("4px").bold(),info:()=>(new StyleBuilder).bg("linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),debug:()=>(new StyleBuilder).bg("linear-gradient(135deg, #667eea 0%, #764ba2 100%)").color("#ffffff").padding("4px 8px").rounded("4px").bold(),muted:()=>(new StyleBuilder).color("#6c757d").font("Monaco, Consolas, monospace").size("12px"),accent:()=>(new StyleBuilder).bg("#f8f9fa").color("#495057").padding("2px 6px").rounded("3px").border("1px solid #dee2e6"),neon:()=>(new StyleBuilder).bg("linear-gradient(135deg, #0f3460 0%, #e94560 100%)").color("#00ffff").padding("4px 8px").rounded("4px").bold().shadow("0 0 10px rgba(0, 255, 255, 0.5)")},o={simple:{text:"đ ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling đ",style:"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;"},ascii:{text:"\n ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____ \n / _ \\ / __ \\| | / / / _ \\ | \\ | |/ ____| ____| _ \\ | | / _ \\ / ____| ___| _ | _ \\ \n / /_\\ \\ / / _` | |/ / / /_\\ \\ | \\| | | | |__ | | | | | | / / \\ \\| | __| |_ | |_| | |_) |\n | _ || | (_| | < | _ | | . ` | | | __| | | | | | | | | | | | |_ | _| | /| _ < \n | | | |\\ \\__,_|_|\\_\\ | | | | | |\\ | |___| |____| |_| | | |__\\ \\_/ /| |__| | |___| |\\ \\| |_) |\n \\_| |_/ \\____/ \\_| |_/ |_| \\_|\\_____|______|____/ |_____/\\___/ \\_____|_____|_| \\_|____/\n\n Advanced Logger v2.0.0 - Console Excellence",style:'font-family: "Courier New", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'},unicode:{text:"\nââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ\nâ đ ADVANCED LOGGER v2.0.0 â\nâ State-of-the-art Console Styling â \nââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ",style:'font-family: "Courier New", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'},svg:{text:" ",style:"\n background-image: url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>đ ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>\");\n background-repeat: no-repeat;\n background-size: 400px 80px;\n padding: 40px 200px;\n color: transparent;\n display: inline-block;\n border-radius: 8px;\n "},animated:{text:" đ ADVANCED LOGGER v2.0.0 ",style:"\n background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);\n background-size: 400% 400%;\n color: white;\n padding: 15px 25px;\n border-radius: 10px;\n font-weight: bold;\n font-size: 14px;\n font-family: monospace;\n animation: gradientShift 3s ease infinite;\n display: inline-block;\n "}};exports.BANNER_VARIANTS=o,exports.StyleBuilder=StyleBuilder,exports.StylePresets=e,exports.THEME_BANNERS={default:{simple:"đ ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling đ",style:"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;"},dark:{simple:"đ ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence đ",style:"background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;"},neon:{simple:"⥠ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience âĄ",style:"background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;"},minimal:{simple:"ADVANCED LOGGER v2.0.0 - Clean Console Styling",style:"background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;"},light:{simple:"âī¸ ADVANCED LOGGER v2.0.0 - Bright Console Styling âī¸",style:"background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;"},cyberpunk:{simple:"đ¤ ADVANCED LOGGER v2.0.0 - Neural Console Interface đ¤",style:"background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;"}},exports.THEME_PRESETS={default:{debug:{emoji:"đ",label:"DEBUG",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",color:"#ffffff",border:"1px solid #667eea",shadow:"0 2px 4px rgba(102, 126, 234, 0.3)"},info:{emoji:"âšī¸",label:"INFO",background:"linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)",color:"#ffffff",border:"1px solid #74b9ff",shadow:"0 2px 4px rgba(116, 185, 255, 0.3)"},warn:{emoji:"â ī¸",label:"WARN",background:"linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)",color:"#2d3436",border:"1px solid #fdcb6e",shadow:"0 2px 4px rgba(253, 203, 110, 0.3)"},error:{emoji:"â",label:"ERROR",background:"linear-gradient(135deg, #e84393 0%, #d63031 100%)",color:"#ffffff",border:"1px solid #e84393",shadow:"0 2px 4px rgba(232, 67, 147, 0.3)"},success:{emoji:"â
",label:"SUCCESS",background:"linear-gradient(135deg, #00b894 0%, #00a085 100%)",color:"#ffffff",border:"1px solid #00b894",shadow:"0 2px 4px rgba(0, 184, 148, 0.3)"},critical:{emoji:"đĨ",label:"CRITICAL",background:"linear-gradient(135deg, #ff3838 0%, #ff1744 100%)",color:"#ffffff",border:"2px solid #ff3838",shadow:"0 4px 8px rgba(255, 56, 56, 0.5)"}},dark:{debug:{emoji:"đ",label:"DEBUG",background:"linear-gradient(135deg, #2d3748 0%, #4a5568 100%)",color:"#e2e8f0",border:"1px solid #4a5568",shadow:"0 2px 4px rgba(45, 55, 72, 0.8)"},info:{emoji:"đĄ",label:"INFO",background:"linear-gradient(135deg, #1a202c 0%, #2d3748 100%)",color:"#90cdf4",border:"1px solid #3182ce",shadow:"0 2px 4px rgba(26, 32, 44, 0.8)"},warn:{emoji:"âĄ",label:"WARN",background:"linear-gradient(135deg, #744210 0%, #975a16 100%)",color:"#faf089",border:"1px solid #d69e2e",shadow:"0 2px 4px rgba(116, 66, 16, 0.8)"},error:{emoji:"đ",label:"ERROR",background:"linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)",color:"#feb2b2",border:"1px solid #e53e3e",shadow:"0 2px 4px rgba(116, 42, 42, 0.8)"},success:{emoji:"đ¯",label:"SUCCESS",background:"linear-gradient(135deg, #276749 0%, #2f855a 100%)",color:"#9ae6b4",border:"1px solid #38a169",shadow:"0 2px 4px rgba(39, 103, 73, 0.8)"},critical:{emoji:"đĨ",label:"CRITICAL",background:"linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)",color:"#ffffff",border:"2px solid #ff0000",shadow:"0 4px 8px rgba(255, 0, 0, 0.9)"}},neon:{debug:{emoji:"âĄ",label:"DEBUG",background:"linear-gradient(135deg, #0f3460 0%, #e94560 100%)",color:"#00ffff",border:"1px solid #00ffff",shadow:"0 0 10px rgba(0, 255, 255, 0.5)"},info:{emoji:"đŽ",label:"INFO",background:"linear-gradient(135deg, #16213e 0%, #0f3460 100%)",color:"#00ff41",border:"1px solid #00ff41",shadow:"0 0 10px rgba(0, 255, 65, 0.5)"},warn:{emoji:"â ī¸",label:"WARN",background:"linear-gradient(135deg, #533a03 0%, #e94560 100%)",color:"#ffff00",border:"1px solid #ffff00",shadow:"0 0 10px rgba(255, 255, 0, 0.5)"},error:{emoji:"đĨ",label:"ERROR",background:"linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)",color:"#ff073a",border:"1px solid #ff073a",shadow:"0 0 10px rgba(255, 7, 58, 0.8)"},success:{emoji:"â¨",label:"SUCCESS",background:"linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)",color:"#39ff14",border:"1px solid #39ff14",shadow:"0 0 10px rgba(57, 255, 20, 0.8)"},critical:{emoji:"đ",label:"CRITICAL",background:"linear-gradient(135deg, #000000 0%, #ff0080 100%)",color:"#ff0080",border:"2px solid #ff0080",shadow:"0 0 20px rgba(255, 0, 128, 1)"}},minimal:{debug:{emoji:"",label:"DEBUG",background:"#f7fafc",color:"#4a5568",border:"1px solid #e2e8f0",shadow:"none"},info:{emoji:"",label:"INFO",background:"#ebf8ff",color:"#2b6cb0",border:"1px solid #bee3f8",shadow:"none"},warn:{emoji:"",label:"WARN",background:"#fffbf0",color:"#c05621",border:"1px solid #fed7aa",shadow:"none"},error:{emoji:"",label:"ERROR",background:"#fef5f5",color:"#c53030",border:"1px solid #fca5a5",shadow:"none"},success:{emoji:"",label:"SUCCESS",background:"#f0fff4",color:"#2f855a",border:"1px solid #9ae6b4",shadow:"none"},critical:{emoji:"",label:"CRITICAL",background:"#fef5f5",color:"#e53e3e",border:"2px solid #f56565",shadow:"none"}},light:{debug:{emoji:"đ",label:"DEBUG",background:"linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)",color:"#1565c0",border:"1px solid #90caf9",shadow:"0 1px 3px rgba(33, 150, 243, 0.2)"},info:{emoji:"âšī¸",label:"INFO",background:"linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)",color:"#7b1fa2",border:"1px solid #ce93d8",shadow:"0 1px 3px rgba(156, 39, 176, 0.2)"},warn:{emoji:"â ī¸",label:"WARN",background:"linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)",color:"#f57c00",border:"1px solid #ffcc02",shadow:"0 1px 3px rgba(255, 152, 0, 0.2)"},error:{emoji:"â",label:"ERROR",background:"linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)",color:"#d32f2f",border:"1px solid #f44336",shadow:"0 1px 3px rgba(244, 67, 54, 0.2)"},success:{emoji:"â
",label:"SUCCESS",background:"linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)",color:"#388e3c",border:"1px solid #4caf50",shadow:"0 1px 3px rgba(76, 175, 80, 0.2)"},critical:{emoji:"đ¨",label:"CRITICAL",background:"linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)",color:"#c2185b",border:"2px solid #e91e63",shadow:"0 2px 6px rgba(233, 30, 99, 0.3)"}},cyberpunk:{debug:{emoji:"đ¤",label:"DEBUG",background:"linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)",color:"#00d4aa",border:"1px solid #00d4aa",shadow:"0 0 15px rgba(0, 212, 170, 0.4)"},info:{emoji:"đ",label:"INFO",background:"linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)",color:"#00b4d8",border:"1px solid #00b4d8",shadow:"0 0 15px rgba(0, 180, 216, 0.4)"},warn:{emoji:"âĄ",label:"WARN",background:"linear-gradient(135deg, #f72585 0%, #b5179e 100%)",color:"#ffff3f",border:"1px solid #ffff3f",shadow:"0 0 15px rgba(255, 255, 63, 0.4)"},error:{emoji:"đ",label:"ERROR",background:"linear-gradient(135deg, #7209b7 0%, #480ca8 100%)",color:"#ff006e",border:"1px solid #ff006e",shadow:"0 0 15px rgba(255, 0, 110, 0.6)"},success:{emoji:"âĄ",label:"SUCCESS",background:"linear-gradient(135deg, #003566 0%, #001d3d 100%)",color:"#00f5ff",border:"1px solid #00f5ff",shadow:"0 0 15px rgba(0, 245, 255, 0.4)"},critical:{emoji:"đĨ",label:"CRITICAL",background:"linear-gradient(135deg, #000000 0%, #ff0040 100%)",color:"#ff0040",border:"2px solid #ff0040",shadow:"0 0 25px rgba(255, 0, 64, 0.8)"}}},exports.displayInitBanner=function(e){const r=e||function(){const e=navigator.userAgent,o=/Chrome/.test(e),r=/Firefox/.test(e),a=/Safari/.test(e)&&!/Chrome/.test(e),d=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;return"undefined"!=typeof document&&"animationName"in document.createElement("div").style&&o?"animated":d&&(o||r)?"svg":o||r?"unicode":a?"ascii":"simple"}(),a=o[r];if("animated"===r){const e=document.createElement("style");e.textContent="\n @keyframes gradientShift {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n ",document.head.appendChild(e)}console.log(`%c${a.text}`,a.style),console.group("%c⨠Features","background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;"),["đ¨ Advanced CSS Console Styling","đ Automatic Stack Trace Parsing","đ§ Scoped Loggers & Prefixes","⥠Performance Timers","đ¯ Verbosity Filtering","đ Extensible Handlers","đą Modern TypeScript Patterns","đ¤ Export & Clipboard Support"].forEach(e=>{console.log(`%c${e}`,"color: #6c757d; font-size: 13px;")}),console.groupEnd(),console.log("")};
|
|
2
|
+
//# sourceMappingURL=styling-tmRDI28D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styling-tmRDI28D.js","sources":["../../src/styling/StyleBuilder.ts","../../src/styling/banners.ts","../../src/styling/themes.ts"],"sourcesContent":["/**\n * @fileoverview StyleBuilder class for Advanced Logger\n */\n\n/**\n * Utility class for creating dynamic console styles with method chaining\n */\nexport class StyleBuilder {\n private styles: string[] = [];\n\n constructor(baseStyle = '') {\n if (baseStyle) this.styles.push(baseStyle);\n }\n\n /**\n * Add background color or gradient\n */\n bg(background: string): StyleBuilder {\n this.styles.push(`background: ${background}`);\n return this;\n }\n\n /**\n * Add text color\n */\n color(color: string): StyleBuilder {\n this.styles.push(`color: ${color}`);\n return this;\n }\n\n /**\n * Add border styling\n */\n border(border: string): StyleBuilder {\n this.styles.push(`border: ${border}`);\n return this;\n }\n\n /**\n * Add box shadow\n */\n shadow(shadow: string): StyleBuilder {\n this.styles.push(`box-shadow: ${shadow}`);\n return this;\n }\n\n /**\n * Add padding\n */\n padding(padding: string): StyleBuilder {\n this.styles.push(`padding: ${padding}`);\n return this;\n }\n\n /**\n * Add margin\n */\n margin(margin: string): StyleBuilder {\n this.styles.push(`margin: ${margin}`);\n return this;\n }\n\n /**\n * Add border radius\n */\n rounded(radius: string = '4px'): StyleBuilder {\n this.styles.push(`border-radius: ${radius}`);\n return this;\n }\n\n /**\n * Add font weight\n */\n bold(): StyleBuilder {\n this.styles.push('font-weight: bold');\n return this;\n }\n\n /**\n * Add font styling\n */\n font(font: string): StyleBuilder {\n this.styles.push(`font-family: ${font}`);\n return this;\n }\n\n /**\n * Add font size\n */\n size(size: string): StyleBuilder {\n this.styles.push(`font-size: ${size}`);\n return this;\n }\n\n /**\n * Add line height\n */\n lineHeight(height: string): StyleBuilder {\n this.styles.push(`line-height: ${height}`);\n return this;\n }\n\n /**\n * Add text decoration\n */\n underline(): StyleBuilder {\n this.styles.push('text-decoration: underline');\n return this;\n }\n\n /**\n * Add text transform\n */\n uppercase(): StyleBuilder {\n this.styles.push('text-transform: uppercase');\n return this;\n }\n\n /**\n * Add opacity\n */\n opacity(value: number): StyleBuilder {\n this.styles.push(`opacity: ${value}`);\n return this;\n }\n\n /**\n * Add display property\n */\n display(value: string): StyleBuilder {\n this.styles.push(`display: ${value}`);\n return this;\n }\n\n /**\n * Add position property\n */\n position(value: string): StyleBuilder {\n this.styles.push(`position: ${value}`);\n return this;\n }\n\n /**\n * Add transform property\n */\n transform(value: string): StyleBuilder {\n this.styles.push(`transform: ${value}`);\n return this;\n }\n\n /**\n * Add animation property\n */\n animation(value: string): StyleBuilder {\n this.styles.push(`animation: ${value}`);\n return this;\n }\n\n /**\n * Add transition property\n */\n transition(value: string): StyleBuilder {\n this.styles.push(`transition: ${value}`);\n return this;\n }\n\n /**\n * Add cursor property\n */\n cursor(value: string): StyleBuilder {\n this.styles.push(`cursor: ${value}`);\n return this;\n }\n\n /**\n * Add any custom CSS property\n */\n custom(property: string, value: string): StyleBuilder {\n this.styles.push(`${property}: ${value}`);\n return this;\n }\n\n /**\n * Add any CSS property (alias for custom)\n */\n css(property: string, value: string): StyleBuilder {\n return this.custom(property, value);\n }\n\n /**\n * Build the final CSS string\n */\n build(): string {\n return this.styles.join('; ');\n }\n\n /**\n * Clear all styles and start fresh\n */\n clear(): StyleBuilder {\n this.styles = [];\n return this;\n }\n\n /**\n * Clone this StyleBuilder with the same styles\n */\n clone(): StyleBuilder {\n const cloned = new StyleBuilder();\n cloned.styles = [...this.styles];\n return cloned;\n }\n\n /**\n * Merge another StyleBuilder's styles into this one\n */\n merge(other: StyleBuilder): StyleBuilder {\n this.styles.push(...other.styles);\n return this;\n }\n}\n\n/**\n * Proxy-based dynamic styler for chainable console styling\n */\nfunction createStyler(): any {\n const builder = new StyleBuilder();\n return new Proxy(builder, {\n get(target: StyleBuilder, prop: string) {\n if (prop in target) {\n const method = (target as any)[prop];\n if (typeof method === 'function') {\n return method.bind(target);\n }\n return method;\n }\n return undefined;\n }\n });\n}\n\n/**\n * Dynamic styler instance for external use\n */\nexport const $ = createStyler();\n\n/**\n * Pre-defined style presets for common use cases\n */\nexport const StylePresets = {\n success: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #00b894 0%, #00a085 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n error: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #e84393 0%, #d63031 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n warning: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)')\n .color('#2d3436')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n info: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n debug: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #667eea 0%, #764ba2 100%)')\n .color('#ffffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold(),\n\n muted: () => new StyleBuilder()\n .color('#6c757d')\n .font('Monaco, Consolas, monospace')\n .size('12px'),\n\n accent: () => new StyleBuilder()\n .bg('#f8f9fa')\n .color('#495057')\n .padding('2px 6px')\n .rounded('3px')\n .border('1px solid #dee2e6'),\n\n neon: () => new StyleBuilder()\n .bg('linear-gradient(135deg, #0f3460 0%, #e94560 100%)')\n .color('#00ffff')\n .padding('4px 8px')\n .rounded('4px')\n .bold()\n .shadow('0 0 10px rgba(0, 255, 255, 0.5)'),\n};","/**\n * @fileoverview Banner configurations for Advanced Logger\n */\n\nimport type { BannerType, ThemeVariant } from '../types/index.js';\n\n/**\n * Banner variants for different display capabilities\n */\nexport const BANNER_VARIANTS = {\n simple: {\n text: 'đ ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling đ',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;'\n },\n ascii: {\n text: `\n ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____ \n / _ \\\\ / __ \\\\| | / / / _ \\\\ | \\\\ | |/ ____| ____| _ \\\\ | | / _ \\\\ / ____| ___| _ | _ \\\\ \n / /_\\\\ \\\\ / / _\\` | |/ / / /_\\\\ \\\\ | \\\\| | | | |__ | | | | | | / / \\\\ \\\\| | __| |_ | |_| | |_) |\n | _ || | (_| | < | _ | | . \\` | | | __| | | | | | | | | | | | |_ | _| | /| _ < \n | | | |\\\\ \\\\__,_|_|\\\\_\\\\ | | | | | |\\\\ | |___| |____| |_| | | |__\\\\ \\\\_/ /| |__| | |___| |\\\\ \\\\| |_) |\n \\\\_| |_/ \\\\____/ \\\\_| |_/ |_| \\\\_|\\\\_____|______|____/ |_____/\\\\___/ \\\\_____|_____|_| \\\\_|____/\n\n Advanced Logger v2.0.0 - Console Excellence`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'\n },\n unicode: {\n text: `\nââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ\nâ đ ADVANCED LOGGER v2.0.0 â\nâ State-of-the-art Console Styling â \nââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ`,\n style: 'font-family: \"Courier New\", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'\n },\n svg: {\n text: ' ',\n style: `\n background-image: url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>đ ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>\");\n background-repeat: no-repeat;\n background-size: 400px 80px;\n padding: 40px 200px;\n color: transparent;\n display: inline-block;\n border-radius: 8px;\n `\n },\n animated: {\n text: ' đ ADVANCED LOGGER v2.0.0 ',\n style: `\n background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);\n background-size: 400% 400%;\n color: white;\n padding: 15px 25px;\n border-radius: 10px;\n font-weight: bold;\n font-size: 14px;\n font-family: monospace;\n animation: gradientShift 3s ease infinite;\n display: inline-block;\n `\n }\n};\n\n/**\n * Theme-specific banners for enhanced visual theming\n */\nexport const THEME_BANNERS: Record<ThemeVariant, { simple: string; style: string }> = {\n default: {\n simple: 'đ ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling đ',\n style: 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;'\n },\n dark: {\n simple: 'đ ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence đ',\n style: 'background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;'\n },\n neon: {\n simple: '⥠ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience âĄ',\n style: 'background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;'\n },\n minimal: {\n simple: 'ADVANCED LOGGER v2.0.0 - Clean Console Styling',\n style: 'background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;'\n },\n light: {\n simple: 'âī¸ ADVANCED LOGGER v2.0.0 - Bright Console Styling âī¸',\n style: 'background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;'\n },\n cyberpunk: {\n simple: 'đ¤ ADVANCED LOGGER v2.0.0 - Neural Console Interface đ¤',\n style: 'background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;'\n }\n};\n\n/**\n * Feature detection for banner capabilities\n */\nexport function detectBannerCapabilities(): BannerType {\n // Try to detect browser capabilities\n const userAgent = navigator.userAgent;\n const isChrome = /Chrome/.test(userAgent);\n const isFirefox = /Firefox/.test(userAgent);\n const isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);\n \n // Check for SVG support (most modern browsers)\n const supportsSVG = !!document.createElementNS && \n !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;\n \n // Check for CSS animation support\n const supportsAnimations = typeof document !== 'undefined' && \n 'animationName' in document.createElement('div').style;\n \n // Progressive enhancement\n if (supportsAnimations && isChrome) {\n return 'animated';\n } else if (supportsSVG && (isChrome || isFirefox)) {\n return 'svg';\n } else if (isChrome || isFirefox) {\n return 'unicode';\n } else if (isSafari) {\n return 'ascii';\n }\n \n return 'simple';\n}\n\n/**\n * Display initialization banner with advanced styling\n */\nexport function displayInitBanner(bannerType?: BannerType): void {\n const selectedType = bannerType || detectBannerCapabilities();\n const banner = BANNER_VARIANTS[selectedType];\n \n // Add CSS animation keyframes if needed\n if (selectedType === 'animated') {\n const style = document.createElement('style');\n style.textContent = `\n @keyframes gradientShift {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n `;\n document.head.appendChild(style);\n }\n \n console.log(`%c${banner.text}`, banner.style);\n\n // Show feature highlights\n const features = [\n 'đ¨ Advanced CSS Console Styling',\n 'đ Automatic Stack Trace Parsing',\n 'đ§ Scoped Loggers & Prefixes',\n '⥠Performance Timers',\n 'đ¯ Verbosity Filtering',\n 'đ Extensible Handlers',\n 'đą Modern TypeScript Patterns',\n 'đ¤ Export & Clipboard Support'\n ];\n\n console.group(`%c⨠Features`, 'background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;');\n\n features.forEach(feature => {\n console.log(`%c${feature}`, 'color: #6c757d; font-size: 13px;');\n });\n\n console.groupEnd();\n console.log(''); // Add spacing\n}","/**\n * @fileoverview Theme presets for Advanced Logger\n */\n\nimport type { ThemeVariant } from '../types/index.js';\nimport type { LevelStyleConfig } from '../utils/index.js';\n\n/**\n * Theme configurations for different visual styles\n */\nexport const THEME_PRESETS: Record<ThemeVariant, Record<string, LevelStyleConfig>> = {\n default: {\n debug: {\n emoji: 'đ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',\n color: '#ffffff', border: '1px solid #667eea',\n shadow: '0 2px 4px rgba(102, 126, 234, 0.3)',\n },\n info: {\n emoji: 'âšī¸', label: 'INFO',\n background: 'linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)',\n color: '#ffffff', border: '1px solid #74b9ff',\n shadow: '0 2px 4px rgba(116, 185, 255, 0.3)',\n },\n warn: {\n emoji: 'â ī¸', label: 'WARN',\n background: 'linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)',\n color: '#2d3436', border: '1px solid #fdcb6e',\n shadow: '0 2px 4px rgba(253, 203, 110, 0.3)',\n },\n error: {\n emoji: 'â', label: 'ERROR',\n background: 'linear-gradient(135deg, #e84393 0%, #d63031 100%)',\n color: '#ffffff', border: '1px solid #e84393',\n shadow: '0 2px 4px rgba(232, 67, 147, 0.3)',\n },\n success: {\n emoji: 'â
', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #00b894 0%, #00a085 100%)',\n color: '#ffffff', border: '1px solid #00b894',\n shadow: '0 2px 4px rgba(0, 184, 148, 0.3)',\n },\n critical: {\n emoji: 'đĨ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #ff3838 0%, #ff1744 100%)',\n color: '#ffffff', border: '2px solid #ff3838',\n shadow: '0 4px 8px rgba(255, 56, 56, 0.5)',\n },\n },\n dark: {\n debug: {\n emoji: 'đ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #2d3748 0%, #4a5568 100%)',\n color: '#e2e8f0', border: '1px solid #4a5568',\n shadow: '0 2px 4px rgba(45, 55, 72, 0.8)',\n },\n info: {\n emoji: 'đĄ', label: 'INFO',\n background: 'linear-gradient(135deg, #1a202c 0%, #2d3748 100%)',\n color: '#90cdf4', border: '1px solid #3182ce',\n shadow: '0 2px 4px rgba(26, 32, 44, 0.8)',\n },\n warn: {\n emoji: 'âĄ', label: 'WARN',\n background: 'linear-gradient(135deg, #744210 0%, #975a16 100%)',\n color: '#faf089', border: '1px solid #d69e2e',\n shadow: '0 2px 4px rgba(116, 66, 16, 0.8)',\n },\n error: {\n emoji: 'đ', label: 'ERROR',\n background: 'linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)',\n color: '#feb2b2', border: '1px solid #e53e3e',\n shadow: '0 2px 4px rgba(116, 42, 42, 0.8)',\n },\n success: {\n emoji: 'đ¯', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #276749 0%, #2f855a 100%)',\n color: '#9ae6b4', border: '1px solid #38a169',\n shadow: '0 2px 4px rgba(39, 103, 73, 0.8)',\n },\n critical: {\n emoji: 'đĨ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)',\n color: '#ffffff', border: '2px solid #ff0000',\n shadow: '0 4px 8px rgba(255, 0, 0, 0.9)',\n },\n },\n neon: {\n debug: {\n emoji: 'âĄ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0f3460 0%, #e94560 100%)',\n color: '#00ffff', border: '1px solid #00ffff',\n shadow: '0 0 10px rgba(0, 255, 255, 0.5)',\n },\n info: {\n emoji: 'đŽ', label: 'INFO',\n background: 'linear-gradient(135deg, #16213e 0%, #0f3460 100%)',\n color: '#00ff41', border: '1px solid #00ff41',\n shadow: '0 0 10px rgba(0, 255, 65, 0.5)',\n },\n warn: {\n emoji: 'â ī¸', label: 'WARN',\n background: 'linear-gradient(135deg, #533a03 0%, #e94560 100%)',\n color: '#ffff00', border: '1px solid #ffff00',\n shadow: '0 0 10px rgba(255, 255, 0, 0.5)',\n },\n error: {\n emoji: 'đĨ', label: 'ERROR',\n background: 'linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)',\n color: '#ff073a', border: '1px solid #ff073a',\n shadow: '0 0 10px rgba(255, 7, 58, 0.8)',\n },\n success: {\n emoji: 'â¨', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)',\n color: '#39ff14', border: '1px solid #39ff14',\n shadow: '0 0 10px rgba(57, 255, 20, 0.8)',\n },\n critical: {\n emoji: 'đ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0080 100%)',\n color: '#ff0080', border: '2px solid #ff0080',\n shadow: '0 0 20px rgba(255, 0, 128, 1)',\n },\n },\n minimal: {\n debug: {\n emoji: '', label: 'DEBUG',\n background: '#f7fafc', color: '#4a5568',\n border: '1px solid #e2e8f0', shadow: 'none',\n },\n info: {\n emoji: '', label: 'INFO',\n background: '#ebf8ff', color: '#2b6cb0',\n border: '1px solid #bee3f8', shadow: 'none',\n },\n warn: {\n emoji: '', label: 'WARN',\n background: '#fffbf0', color: '#c05621',\n border: '1px solid #fed7aa', shadow: 'none',\n },\n error: {\n emoji: '', label: 'ERROR',\n background: '#fef5f5', color: '#c53030',\n border: '1px solid #fca5a5', shadow: 'none',\n },\n success: {\n emoji: '', label: 'SUCCESS',\n background: '#f0fff4', color: '#2f855a',\n border: '1px solid #9ae6b4', shadow: 'none',\n },\n critical: {\n emoji: '', label: 'CRITICAL',\n background: '#fef5f5', color: '#e53e3e',\n border: '2px solid #f56565', shadow: 'none',\n },\n },\n // Additional theme variants can be added here\n light: {\n debug: {\n emoji: 'đ', label: 'DEBUG',\n background: 'linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)',\n color: '#1565c0', border: '1px solid #90caf9',\n shadow: '0 1px 3px rgba(33, 150, 243, 0.2)',\n },\n info: {\n emoji: 'âšī¸', label: 'INFO',\n background: 'linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)',\n color: '#7b1fa2', border: '1px solid #ce93d8',\n shadow: '0 1px 3px rgba(156, 39, 176, 0.2)',\n },\n warn: {\n emoji: 'â ī¸', label: 'WARN',\n background: 'linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)',\n color: '#f57c00', border: '1px solid #ffcc02',\n shadow: '0 1px 3px rgba(255, 152, 0, 0.2)',\n },\n error: {\n emoji: 'â', label: 'ERROR',\n background: 'linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)',\n color: '#d32f2f', border: '1px solid #f44336',\n shadow: '0 1px 3px rgba(244, 67, 54, 0.2)',\n },\n success: {\n emoji: 'â
', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)',\n color: '#388e3c', border: '1px solid #4caf50',\n shadow: '0 1px 3px rgba(76, 175, 80, 0.2)',\n },\n critical: {\n emoji: 'đ¨', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)',\n color: '#c2185b', border: '2px solid #e91e63',\n shadow: '0 2px 6px rgba(233, 30, 99, 0.3)',\n },\n },\n cyberpunk: {\n debug: {\n emoji: 'đ¤', label: 'DEBUG',\n background: 'linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)',\n color: '#00d4aa', border: '1px solid #00d4aa',\n shadow: '0 0 15px rgba(0, 212, 170, 0.4)',\n },\n info: {\n emoji: 'đ', label: 'INFO',\n background: 'linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)',\n color: '#00b4d8', border: '1px solid #00b4d8',\n shadow: '0 0 15px rgba(0, 180, 216, 0.4)',\n },\n warn: {\n emoji: 'âĄ', label: 'WARN',\n background: 'linear-gradient(135deg, #f72585 0%, #b5179e 100%)',\n color: '#ffff3f', border: '1px solid #ffff3f',\n shadow: '0 0 15px rgba(255, 255, 63, 0.4)',\n },\n error: {\n emoji: 'đ', label: 'ERROR',\n background: 'linear-gradient(135deg, #7209b7 0%, #480ca8 100%)',\n color: '#ff006e', border: '1px solid #ff006e',\n shadow: '0 0 15px rgba(255, 0, 110, 0.6)',\n },\n success: {\n emoji: 'âĄ', label: 'SUCCESS',\n background: 'linear-gradient(135deg, #003566 0%, #001d3d 100%)',\n color: '#00f5ff', border: '1px solid #00f5ff',\n shadow: '0 0 15px rgba(0, 245, 255, 0.4)',\n },\n critical: {\n emoji: 'đĨ', label: 'CRITICAL',\n background: 'linear-gradient(135deg, #000000 0%, #ff0040 100%)',\n color: '#ff0040', border: '2px solid #ff0040',\n shadow: '0 0 25px rgba(255, 0, 64, 0.8)',\n },\n },\n};"],"names":["StyleBuilder","styles","constructor","baseStyle","this","push","bg","background","color","border","shadow","padding","margin","rounded","radius","bold","font","size","lineHeight","height","underline","uppercase","opacity","value","display","position","transform","animation","transition","cursor","custom","property","css","build","join","clear","clone","cloned","merge","other","builder","Proxy","get","target","prop","method","bind","createStyler","StylePresets","success","error","warning","info","debug","muted","accent","neon","BANNER_VARIANTS","simple","text","style","ascii","unicode","svg","animated","default","dark","minimal","light","cyberpunk","emoji","label","warn","critical","bannerType","selectedType","userAgent","navigator","isChrome","test","isFirefox","isSafari","supportsSVG","document","createElementNS","createSVGRect","createElement","detectBannerCapabilities","banner","textContent","head","appendChild","console","log","group","forEach","feature","groupEnd"],"mappings":"aAOO,MAAMA,aACDC,OAAmB,GAE3B,WAAAC,CAAYC,EAAY,IAChBA,GAAWC,KAAKH,OAAOI,KAAKF,EACpC,CAKA,EAAAG,CAAGC,GAEC,OADAH,KAAKH,OAAOI,KAAK,eAAeE,KACzBH,IACX,CAKA,KAAAI,CAAMA,GAEF,OADAJ,KAAKH,OAAOI,KAAK,UAAUG,KACpB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SACrC1B,EAAM6B,YAAc,wOAOpBN,SAASO,KAAKC,YAAY/B,EAC9B,CAEAgC,QAAQC,IAAI,KAAKL,EAAO7B,OAAQ6B,EAAO5B,OAcvCgC,QAAQE,MAAM,eAAgB,iGAXb,CACb,kCACA,mCACA,+BACA,uBACA,yBACA,yBACA,gCACA,iCAKKC,QAAQC,IACbJ,QAAQC,IAAI,KAAKG,IAAW,sCAGhCJ,QAAQK,WACRL,QAAQC,IAAI,GAChB"}
|
package/dist/core.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/core-DyugwSYZ.js");require("./chunks/styling-tmRDI28D.js");class CoreLogger{config;scopedPrefix;handlers=[];timers=/* @__PURE__ */new Map;groupDepth=0;constructor(o={}){this.config={...e.DEFAULT_CONFIG,...o,enableColors:!1,enableTimestamps:o.enableTimestamps??!0,enableStackTrace:o.enableStackTrace??!1}}getConfig(){return{...this.config}}setGlobalPrefix(e){this.config.globalPrefix=e}setVerbosity(e){this.config.verbosity=e}createScopedLogger(e){const o=new CoreLogger(this.config);return o.scopedPrefix=e,o.handlers=[...this.handlers],o}addHandler(e){this.handlers.push(e)}shouldLog(e){if("silent"===this.config.verbosity)return!1;const o={debug:0,info:1,warn:2,error:3,critical:4};return o[e]>=o[this.config.verbosity]}getEffectivePrefix(){const e=[this.config.globalPrefix,this.scopedPrefix].filter(Boolean);return e.length>0?e.join(":"):void 0}log(o,...t){if(!this.shouldLog(o))return;const r=this.getEffectivePrefix(),s=this.config.enableTimestamps?e.formatTimestamp():null,i=this.config.enableStackTrace?e.parseStackTrace():null,n=[];s&&n.push(`[${s.slice(11,23)}]`),n.push(`[${o.toUpperCase()}]`),r&&n.push(`[${r}]`);const l=" ".repeat(this.groupDepth)+n.join(" ");console.log(l,...t),i&&this.config.enableStackTrace&&console.log(` at ${i.file}:${i.line}:${i.column}`);const c={timestamp:s||e.formatTimestamp(),level:o,prefix:r,stackInfo:i||void 0};this.handlers.forEach(e=>{try{e.handle(o,String(t[0]||""),t,c)}catch(r){console.error("Log handler failed:",r)}})}debug(...e){this.log("debug",...e)}info(...e){this.log("info",...e)}warn(...e){this.log("warn",...e)}error(...e){this.log("error",...e)}critical(...e){this.log("critical",...e)}trace(...e){this.log("debug",...e),this.shouldLog("debug")&&console.trace(...e)}table(e,o){if(!this.shouldLog("info"))return;const t=this.getEffectivePrefix();console.log(`[TABLE]${t?` [${t}]`:""}:`),o?console.table(e,o):console.table(e)}group(e,o=!1){const t=this.getEffectivePrefix(),r=`${t?`[${t}] `:""}${e}`;o?console.groupCollapsed(r):console.group(r),this.groupDepth++}groupEnd(){this.groupDepth>0&&(console.groupEnd(),this.groupDepth--)}time(e){const o={label:e,startTime:performance.now()};this.timers.set(e,o),console.log(`[TIMER] Started: ${e}`)}timeEnd(e){const o=this.timers.get(e);if(!o)return void this.warn(`Timer '${e}' does not exist`);const t=performance.now()-o.startTime;this.timers.delete(e),console.log(`[TIMER] ${e}: ${t.toFixed(2)}ms`)}}const o=new CoreLogger;exports.CoreLogger=CoreLogger,exports.addHandler=e=>o.addHandler(e),exports.createScopedLogger=e=>o.createScopedLogger(e),exports.critical=(...e)=>o.critical(...e),exports.debug=(...e)=>o.debug(...e),exports.default=o,exports.error=(...e)=>o.error(...e),exports.group=(e,t)=>o.group(e,t),exports.groupEnd=()=>o.groupEnd(),exports.info=(...e)=>o.info(...e),exports.setGlobalPrefix=e=>o.setGlobalPrefix(e),exports.setVerbosity=e=>o.setVerbosity(e),exports.table=(e,t)=>o.table(e,t),exports.time=e=>o.time(e),exports.timeEnd=e=>o.timeEnd(e),exports.trace=(...e)=>o.trace(...e),exports.warn=(...e)=>o.warn(...e);
|
|
2
|
+
//# sourceMappingURL=core.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.cjs","sources":["../src/core.ts"],"sourcesContent":["/**\n * @fileoverview Core Logger Module - Minimal logging without advanced features\n * @version 0.0.1\n * \n * This module provides the essential logging functionality without visual enhancements,\n * SVG support, or advanced styling. Perfect for lightweight applications or server-side usage.\n */\n\n// Core types\nimport type {\n LogLevel,\n Verbosity,\n LoggerConfig,\n ILogHandler,\n LogMetadata,\n TimerEntry\n} from './types/index.js';\n\n// Core utilities only\nimport {\n parseStackTrace,\n formatTimestamp\n} from './utils/index.js';\n\n// Minimal constants\nimport { DEFAULT_CONFIG } from './constants.js';\n\n/**\n * Minimal Logger class with core functionality only\n * \n * @example\n * ```typescript\n * import { CoreLogger } from '@mks2508/better-logger/core';\n * \n * const logger = new CoreLogger();\n * logger.info('Hello world');\n * logger.error('Something went wrong', error);\n * ```\n */\nexport class CoreLogger {\n private config: LoggerConfig;\n private scopedPrefix?: string;\n private handlers: ILogHandler[] = [];\n private timers: Map<string, TimerEntry> = new Map();\n private groupDepth: number = 0;\n\n /**\n * Creates a new CoreLogger instance\n * @param config - Optional configuration\n */\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = {\n ...DEFAULT_CONFIG,\n ...config,\n // Force disable advanced features for core module\n enableColors: false,\n enableTimestamps: config.enableTimestamps ?? true,\n enableStackTrace: config.enableStackTrace ?? false,\n };\n }\n\n // ===== CONFIGURATION METHODS =====\n\n /**\n * Get current configuration\n */\n getConfig(): LoggerConfig {\n return { ...this.config };\n }\n\n /**\n * Sets the global prefix for all log messages\n */\n setGlobalPrefix(prefix: string): void {\n this.config.globalPrefix = prefix;\n }\n\n /**\n * Sets the verbosity level for filtering log output\n */\n setVerbosity(level: Verbosity): void {\n this.config.verbosity = level;\n }\n\n /**\n * Creates a scoped logger with a specific prefix\n */\n createScopedLogger(prefix: string): CoreLogger {\n const scopedLogger = new CoreLogger(this.config);\n scopedLogger.scopedPrefix = prefix;\n scopedLogger.handlers = [...this.handlers];\n return scopedLogger;\n }\n\n /**\n * Adds a custom log handler for extensibility\n */\n addHandler(handler: ILogHandler): void {\n this.handlers.push(handler);\n }\n\n // ===== CORE LOGGING METHODS =====\n\n /**\n * Checks if a log level should be output based on current verbosity\n */\n private shouldLog(level: LogLevel): boolean {\n if (this.config.verbosity === 'silent') return false;\n const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };\n return levels[level] >= levels[this.config.verbosity];\n }\n\n /**\n * Gets the effective prefix (global + scoped)\n */\n private getEffectivePrefix(): string | undefined {\n const parts = [this.config.globalPrefix, this.scopedPrefix].filter(Boolean);\n return parts.length > 0 ? parts.join(':') : undefined;\n }\n\n /**\n * Core logging method with minimal formatting\n */\n private log(level: LogLevel, ...args: any[]): void {\n if (!this.shouldLog(level)) return;\n\n const prefix = this.getEffectivePrefix();\n const timestamp = this.config.enableTimestamps ? formatTimestamp() : null;\n const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;\n \n // Simple formatting without CSS styling\n const parts: string[] = [];\n \n if (timestamp) {\n parts.push(`[${timestamp.slice(11, 23)}]`);\n }\n \n parts.push(`[${level.toUpperCase()}]`);\n \n if (prefix) {\n parts.push(`[${prefix}]`);\n }\n\n const groupIndent = ' '.repeat(this.groupDepth);\n const logPrefix = groupIndent + parts.join(' ');\n \n // Output to console with simple formatting\n console.log(logPrefix, ...args);\n \n if (stackInfo && this.config.enableStackTrace) {\n console.log(` at ${stackInfo.file}:${stackInfo.line}:${stackInfo.column}`);\n }\n\n // Call custom handlers\n const metadata: LogMetadata = {\n timestamp: timestamp || formatTimestamp(),\n level,\n prefix,\n stackInfo: stackInfo || undefined,\n };\n\n this.handlers.forEach(handler => {\n try {\n handler.handle(level, String(args[0] || ''), args, metadata);\n } catch (error) {\n console.error('Log handler failed:', error);\n }\n });\n }\n\n /**\n * Logs debug information (lowest priority)\n */\n debug(...args: any[]): void {\n this.log('debug', ...args);\n }\n\n /**\n * Logs informational messages\n */\n info(...args: any[]): void {\n this.log('info', ...args);\n }\n\n /**\n * Logs warning messages\n */\n warn(...args: any[]): void {\n this.log('warn', ...args);\n }\n\n /**\n * Logs error messages\n */\n error(...args: any[]): void {\n this.log('error', ...args);\n }\n\n /**\n * Logs critical errors (highest priority)\n */\n critical(...args: any[]): void {\n this.log('critical', ...args);\n }\n\n /**\n * Logs trace information (detailed debugging)\n */\n trace(...args: any[]): void {\n this.log('debug', ...args);\n if (this.shouldLog('debug')) {\n console.trace(...args);\n }\n }\n\n // ===== BASIC ADVANCED FEATURES =====\n\n /**\n * Displays data in a table format\n */\n table(data: any, columns?: string[]): void {\n if (!this.shouldLog('info')) return;\n\n const prefix = this.getEffectivePrefix();\n console.log(`[TABLE]${prefix ? ` [${prefix}]` : ''}:`);\n \n if (columns) {\n console.table(data, columns);\n } else {\n console.table(data);\n }\n }\n\n /**\n * Starts a collapsible group in the console\n */\n group(label: string, collapsed: boolean = false): void {\n const prefix = this.getEffectivePrefix();\n const fullLabel = `${prefix ? `[${prefix}] ` : ''}${label}`;\n \n if (collapsed) {\n console.groupCollapsed(fullLabel);\n } else {\n console.group(fullLabel);\n }\n \n this.groupDepth++;\n }\n\n /**\n * Ends the current console group\n */\n groupEnd(): void {\n if (this.groupDepth > 0) {\n console.groupEnd();\n this.groupDepth--;\n }\n }\n\n /**\n * Starts a timer with the given label\n */\n time(label: string): void {\n const timer: TimerEntry = {\n label,\n startTime: performance.now(),\n };\n this.timers.set(label, timer);\n console.log(`[TIMER] Started: ${label}`);\n }\n\n /**\n * Ends a timer and logs the elapsed time\n */\n timeEnd(label: string): void {\n const timer = this.timers.get(label);\n if (!timer) {\n this.warn(`Timer '${label}' does not exist`);\n return;\n }\n\n const elapsed = performance.now() - timer.startTime;\n this.timers.delete(label);\n console.log(`[TIMER] ${label}: ${elapsed.toFixed(2)}ms`);\n }\n}\n\n// Create and export singleton instance for convenience\nconst coreLogger = new CoreLogger();\n\n/**\n * Export individual methods for convenience (with proper binding)\n */\nexport const debug = (...args: any[]) => coreLogger.debug(...args);\nexport const info = (...args: any[]) => coreLogger.info(...args);\nexport const warn = (...args: any[]) => coreLogger.warn(...args);\nexport const error = (...args: any[]) => coreLogger.error(...args);\nexport const critical = (...args: any[]) => coreLogger.critical(...args);\nexport const trace = (...args: any[]) => coreLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => coreLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => coreLogger.group(label, collapsed);\nexport const groupEnd = () => coreLogger.groupEnd();\nexport const time = (label: string) => coreLogger.time(label);\nexport const timeEnd = (label: string) => coreLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => coreLogger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => coreLogger.createScopedLogger(prefix);\nexport const setVerbosity = (level: Verbosity) => coreLogger.setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => coreLogger.addHandler(handler);\n\n// Export the singleton as default\nexport default coreLogger;\n\n// Re-export core types\nexport type {\n LogLevel,\n Verbosity,\n LoggerConfig,\n ILogHandler,\n LogMetadata\n} from './types/index.js';"],"names":["CoreLogger","config","scopedPrefix","handlers","timers","Map","groupDepth","constructor","this","DEFAULT_CONFIG","enableColors","enableTimestamps","enableStackTrace","getConfig","setGlobalPrefix","prefix","globalPrefix","setVerbosity","level","verbosity","createScopedLogger","scopedLogger","addHandler","handler","push","shouldLog","levels","debug","info","warn","error","critical","getEffectivePrefix","parts","filter","Boolean","length","join","log","args","timestamp","formatTimestamp","stackInfo","parseStackTrace","slice","toUpperCase","logPrefix","repeat","console","file","line","column","metadata","forEach","handle","String","trace","table","data","columns","group","label","collapsed","fullLabel","groupCollapsed","groupEnd","time","timer","startTime","performance","now","set","timeEnd","get","elapsed","delete","toFixed","coreLogger"],"mappings":"iMAuCO,MAAMA,WACDC,OACAC,aACAC,SAA0B,GAC1BC,0BAAsCC,IACtCC,WAAqB,EAM7B,WAAAC,CAAYN,EAAgC,IACxCO,KAAKP,OAAS,IACPQ,EAAAA,kBACAR,EAEHS,cAAc,EACdC,iBAAkBV,EAAOU,mBAAoB,EAC7CC,iBAAkBX,EAAOW,mBAAoB,EAErD,CAOA,SAAAC,GACI,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ACvBnB,QAAQV,IAAI,oBAAoBuB,IACpC,CAKA,OAAAW,CAAQX,GACJ,MAAMM,EAAQ3D,KAAKJ,OAAOqE,IAAIZ,GAC9B,IAAKM,EAED,YADA3D,KAAKqB,KAAK,UAAUgC,qBAIxB,MAAMa,EAAUL,YAAYC,MAAQH,EAAMC,UAC1C5D,KAAKJ,OAAOuE,OAAOd,GACnBb,QAAQV,IAAI,WAAWuB,MAAUa,EAAQE,QAAQ,OACrD,EAIJ,MAAMC,EAAa,IAAI7E,4DAmBIuB,GAAyBsD,EAAWvD,WAAWC,8BAFvCR,GAAmB8D,EAAWzD,mBAAmBL,oBAR5D,IAAIwB,IAAgBsC,EAAW9C,YAAYQ,iBAJ9C,IAAIA,IAAgBsC,EAAWlD,SAASY,mCAGxC,IAAIA,IAAgBsC,EAAW/C,SAASS,iBAIxC,CAACsB,EAAeC,IAAwBe,EAAWjB,MAAMC,EAAOC,oBAC7D,IAAMe,EAAWZ,wBAPrB,IAAI1B,IAAgBsC,EAAWjD,QAAQW,2BAU3BxB,GAAmB8D,EAAW/D,gBAAgBC,wBAEjDG,GAAqB2D,EAAW5D,aAAaC,iBAPrD,CAACwC,EAAWC,IAAuBkB,EAAWpB,MAAMC,EAAMC,gBAG1DE,GAAkBgB,EAAWX,KAAKL,mBAC/BA,GAAkBgB,EAAWL,QAAQX,iBALxC,IAAItB,IAAgBsC,EAAWrB,SAASjB,gBAHzC,IAAIA,IAAgBsC,EAAWhD,QAAQU"}
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { D as DEFAULT_CONFIG, b as formatTimestamp, a as parseStackTrace } from "./chunks/core-2opW4Pi3.js";
|
|
2
|
+
import "./chunks/styling-DhUDzwlE.js";
|
|
3
|
+
class CoreLogger {
|
|
4
|
+
config;
|
|
5
|
+
scopedPrefix;
|
|
6
|
+
handlers = [];
|
|
7
|
+
timers = /* @__PURE__ */ new Map();
|
|
8
|
+
groupDepth = 0;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new CoreLogger instance
|
|
11
|
+
* @param config - Optional configuration
|
|
12
|
+
*/
|
|
13
|
+
constructor(config = {}) {
|
|
14
|
+
this.config = {
|
|
15
|
+
...DEFAULT_CONFIG,
|
|
16
|
+
...config,
|
|
17
|
+
// Force disable advanced features for core module
|
|
18
|
+
enableColors: false,
|
|
19
|
+
enableTimestamps: config.enableTimestamps ?? true,
|
|
20
|
+
enableStackTrace: config.enableStackTrace ?? false
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// ===== CONFIGURATION METHODS =====
|
|
24
|
+
/**
|
|
25
|
+
* Get current configuration
|
|
26
|
+
*/
|
|
27
|
+
getConfig() {
|
|
28
|
+
return { ...this.config };
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sets the global prefix for all log messages
|
|
32
|
+
*/
|
|
33
|
+
setGlobalPrefix(prefix) {
|
|
34
|
+
this.config.globalPrefix = prefix;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Sets the verbosity level for filtering log output
|
|
38
|
+
*/
|
|
39
|
+
setVerbosity(level) {
|
|
40
|
+
this.config.verbosity = level;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a scoped logger with a specific prefix
|
|
44
|
+
*/
|
|
45
|
+
createScopedLogger(prefix) {
|
|
46
|
+
const scopedLogger = new CoreLogger(this.config);
|
|
47
|
+
scopedLogger.scopedPrefix = prefix;
|
|
48
|
+
scopedLogger.handlers = [...this.handlers];
|
|
49
|
+
return scopedLogger;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Adds a custom log handler for extensibility
|
|
53
|
+
*/
|
|
54
|
+
addHandler(handler) {
|
|
55
|
+
this.handlers.push(handler);
|
|
56
|
+
}
|
|
57
|
+
// ===== CORE LOGGING METHODS =====
|
|
58
|
+
/**
|
|
59
|
+
* Checks if a log level should be output based on current verbosity
|
|
60
|
+
*/
|
|
61
|
+
shouldLog(level) {
|
|
62
|
+
if (this.config.verbosity === "silent") return false;
|
|
63
|
+
const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };
|
|
64
|
+
return levels[level] >= levels[this.config.verbosity];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Gets the effective prefix (global + scoped)
|
|
68
|
+
*/
|
|
69
|
+
getEffectivePrefix() {
|
|
70
|
+
const parts = [this.config.globalPrefix, this.scopedPrefix].filter(Boolean);
|
|
71
|
+
return parts.length > 0 ? parts.join(":") : void 0;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Core logging method with minimal formatting
|
|
75
|
+
*/
|
|
76
|
+
log(level, ...args) {
|
|
77
|
+
if (!this.shouldLog(level)) return;
|
|
78
|
+
const prefix = this.getEffectivePrefix();
|
|
79
|
+
const timestamp = this.config.enableTimestamps ? formatTimestamp() : null;
|
|
80
|
+
const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;
|
|
81
|
+
const parts = [];
|
|
82
|
+
if (timestamp) {
|
|
83
|
+
parts.push(`[${timestamp.slice(11, 23)}]`);
|
|
84
|
+
}
|
|
85
|
+
parts.push(`[${level.toUpperCase()}]`);
|
|
86
|
+
if (prefix) {
|
|
87
|
+
parts.push(`[${prefix}]`);
|
|
88
|
+
}
|
|
89
|
+
const groupIndent = " ".repeat(this.groupDepth);
|
|
90
|
+
const logPrefix = groupIndent + parts.join(" ");
|
|
91
|
+
console.log(logPrefix, ...args);
|
|
92
|
+
if (stackInfo && this.config.enableStackTrace) {
|
|
93
|
+
console.log(` at ${stackInfo.file}:${stackInfo.line}:${stackInfo.column}`);
|
|
94
|
+
}
|
|
95
|
+
const metadata = {
|
|
96
|
+
timestamp: timestamp || formatTimestamp(),
|
|
97
|
+
level,
|
|
98
|
+
prefix,
|
|
99
|
+
stackInfo: stackInfo || void 0
|
|
100
|
+
};
|
|
101
|
+
this.handlers.forEach((handler) => {
|
|
102
|
+
try {
|
|
103
|
+
handler.handle(level, String(args[0] || ""), args, metadata);
|
|
104
|
+
} catch (error2) {
|
|
105
|
+
console.error("Log handler failed:", error2);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Logs debug information (lowest priority)
|
|
111
|
+
*/
|
|
112
|
+
debug(...args) {
|
|
113
|
+
this.log("debug", ...args);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Logs informational messages
|
|
117
|
+
*/
|
|
118
|
+
info(...args) {
|
|
119
|
+
this.log("info", ...args);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Logs warning messages
|
|
123
|
+
*/
|
|
124
|
+
warn(...args) {
|
|
125
|
+
this.log("warn", ...args);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Logs error messages
|
|
129
|
+
*/
|
|
130
|
+
error(...args) {
|
|
131
|
+
this.log("error", ...args);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Logs critical errors (highest priority)
|
|
135
|
+
*/
|
|
136
|
+
critical(...args) {
|
|
137
|
+
this.log("critical", ...args);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Logs trace information (detailed debugging)
|
|
141
|
+
*/
|
|
142
|
+
trace(...args) {
|
|
143
|
+
this.log("debug", ...args);
|
|
144
|
+
if (this.shouldLog("debug")) {
|
|
145
|
+
console.trace(...args);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// ===== BASIC ADVANCED FEATURES =====
|
|
149
|
+
/**
|
|
150
|
+
* Displays data in a table format
|
|
151
|
+
*/
|
|
152
|
+
table(data, columns) {
|
|
153
|
+
if (!this.shouldLog("info")) return;
|
|
154
|
+
const prefix = this.getEffectivePrefix();
|
|
155
|
+
console.log(`[TABLE]${prefix ? ` [${prefix}]` : ""}:`);
|
|
156
|
+
if (columns) {
|
|
157
|
+
console.table(data, columns);
|
|
158
|
+
} else {
|
|
159
|
+
console.table(data);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Starts a collapsible group in the console
|
|
164
|
+
*/
|
|
165
|
+
group(label, collapsed = false) {
|
|
166
|
+
const prefix = this.getEffectivePrefix();
|
|
167
|
+
const fullLabel = `${prefix ? `[${prefix}] ` : ""}${label}`;
|
|
168
|
+
if (collapsed) {
|
|
169
|
+
console.groupCollapsed(fullLabel);
|
|
170
|
+
} else {
|
|
171
|
+
console.group(fullLabel);
|
|
172
|
+
}
|
|
173
|
+
this.groupDepth++;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Ends the current console group
|
|
177
|
+
*/
|
|
178
|
+
groupEnd() {
|
|
179
|
+
if (this.groupDepth > 0) {
|
|
180
|
+
console.groupEnd();
|
|
181
|
+
this.groupDepth--;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Starts a timer with the given label
|
|
186
|
+
*/
|
|
187
|
+
time(label) {
|
|
188
|
+
const timer = {
|
|
189
|
+
label,
|
|
190
|
+
startTime: performance.now()
|
|
191
|
+
};
|
|
192
|
+
this.timers.set(label, timer);
|
|
193
|
+
console.log(`[TIMER] Started: ${label}`);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Ends a timer and logs the elapsed time
|
|
197
|
+
*/
|
|
198
|
+
timeEnd(label) {
|
|
199
|
+
const timer = this.timers.get(label);
|
|
200
|
+
if (!timer) {
|
|
201
|
+
this.warn(`Timer '${label}' does not exist`);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const elapsed = performance.now() - timer.startTime;
|
|
205
|
+
this.timers.delete(label);
|
|
206
|
+
console.log(`[TIMER] ${label}: ${elapsed.toFixed(2)}ms`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const coreLogger = new CoreLogger();
|
|
210
|
+
const debug = (...args) => coreLogger.debug(...args);
|
|
211
|
+
const info = (...args) => coreLogger.info(...args);
|
|
212
|
+
const warn = (...args) => coreLogger.warn(...args);
|
|
213
|
+
const error = (...args) => coreLogger.error(...args);
|
|
214
|
+
const critical = (...args) => coreLogger.critical(...args);
|
|
215
|
+
const trace = (...args) => coreLogger.trace(...args);
|
|
216
|
+
const table = (data, columns) => coreLogger.table(data, columns);
|
|
217
|
+
const group = (label, collapsed) => coreLogger.group(label, collapsed);
|
|
218
|
+
const groupEnd = () => coreLogger.groupEnd();
|
|
219
|
+
const time = (label) => coreLogger.time(label);
|
|
220
|
+
const timeEnd = (label) => coreLogger.timeEnd(label);
|
|
221
|
+
const setGlobalPrefix = (prefix) => coreLogger.setGlobalPrefix(prefix);
|
|
222
|
+
const createScopedLogger = (prefix) => coreLogger.createScopedLogger(prefix);
|
|
223
|
+
const setVerbosity = (level) => coreLogger.setVerbosity(level);
|
|
224
|
+
const addHandler = (handler) => coreLogger.addHandler(handler);
|
|
225
|
+
export {
|
|
226
|
+
CoreLogger,
|
|
227
|
+
addHandler,
|
|
228
|
+
createScopedLogger,
|
|
229
|
+
critical,
|
|
230
|
+
debug,
|
|
231
|
+
coreLogger as default,
|
|
232
|
+
error,
|
|
233
|
+
group,
|
|
234
|
+
groupEnd,
|
|
235
|
+
info,
|
|
236
|
+
setGlobalPrefix,
|
|
237
|
+
setVerbosity,
|
|
238
|
+
table,
|
|
239
|
+
time,
|
|
240
|
+
timeEnd,
|
|
241
|
+
trace,
|
|
242
|
+
warn
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sources":["../src/core.ts"],"sourcesContent":["/**\n * @fileoverview Core Logger Module - Minimal logging without advanced features\n * @version 0.0.1\n * \n * This module provides the essential logging functionality without visual enhancements,\n * SVG support, or advanced styling. Perfect for lightweight applications or server-side usage.\n */\n\n// Core types\nimport type {\n LogLevel,\n Verbosity,\n LoggerConfig,\n ILogHandler,\n LogMetadata,\n TimerEntry\n} from './types/index.js';\n\n// Core utilities only\nimport {\n parseStackTrace,\n formatTimestamp\n} from './utils/index.js';\n\n// Minimal constants\nimport { DEFAULT_CONFIG } from './constants.js';\n\n/**\n * Minimal Logger class with core functionality only\n * \n * @example\n * ```typescript\n * import { CoreLogger } from '@mks2508/better-logger/core';\n * \n * const logger = new CoreLogger();\n * logger.info('Hello world');\n * logger.error('Something went wrong', error);\n * ```\n */\nexport class CoreLogger {\n private config: LoggerConfig;\n private scopedPrefix?: string;\n private handlers: ILogHandler[] = [];\n private timers: Map<string, TimerEntry> = new Map();\n private groupDepth: number = 0;\n\n /**\n * Creates a new CoreLogger instance\n * @param config - Optional configuration\n */\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = {\n ...DEFAULT_CONFIG,\n ...config,\n // Force disable advanced features for core module\n enableColors: false,\n enableTimestamps: config.enableTimestamps ?? true,\n enableStackTrace: config.enableStackTrace ?? false,\n };\n }\n\n // ===== CONFIGURATION METHODS =====\n\n /**\n * Get current configuration\n */\n getConfig(): LoggerConfig {\n return { ...this.config };\n }\n\n /**\n * Sets the global prefix for all log messages\n */\n setGlobalPrefix(prefix: string): void {\n this.config.globalPrefix = prefix;\n }\n\n /**\n * Sets the verbosity level for filtering log output\n */\n setVerbosity(level: Verbosity): void {\n this.config.verbosity = level;\n }\n\n /**\n * Creates a scoped logger with a specific prefix\n */\n createScopedLogger(prefix: string): CoreLogger {\n const scopedLogger = new CoreLogger(this.config);\n scopedLogger.scopedPrefix = prefix;\n scopedLogger.handlers = [...this.handlers];\n return scopedLogger;\n }\n\n /**\n * Adds a custom log handler for extensibility\n */\n addHandler(handler: ILogHandler): void {\n this.handlers.push(handler);\n }\n\n // ===== CORE LOGGING METHODS =====\n\n /**\n * Checks if a log level should be output based on current verbosity\n */\n private shouldLog(level: LogLevel): boolean {\n if (this.config.verbosity === 'silent') return false;\n const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };\n return levels[level] >= levels[this.config.verbosity];\n }\n\n /**\n * Gets the effective prefix (global + scoped)\n */\n private getEffectivePrefix(): string | undefined {\n const parts = [this.config.globalPrefix, this.scopedPrefix].filter(Boolean);\n return parts.length > 0 ? parts.join(':') : undefined;\n }\n\n /**\n * Core logging method with minimal formatting\n */\n private log(level: LogLevel, ...args: any[]): void {\n if (!this.shouldLog(level)) return;\n\n const prefix = this.getEffectivePrefix();\n const timestamp = this.config.enableTimestamps ? formatTimestamp() : null;\n const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;\n \n // Simple formatting without CSS styling\n const parts: string[] = [];\n \n if (timestamp) {\n parts.push(`[${timestamp.slice(11, 23)}]`);\n }\n \n parts.push(`[${level.toUpperCase()}]`);\n \n if (prefix) {\n parts.push(`[${prefix}]`);\n }\n\n const groupIndent = ' '.repeat(this.groupDepth);\n const logPrefix = groupIndent + parts.join(' ');\n \n // Output to console with simple formatting\n console.log(logPrefix, ...args);\n \n if (stackInfo && this.config.enableStackTrace) {\n console.log(` at ${stackInfo.file}:${stackInfo.line}:${stackInfo.column}`);\n }\n\n // Call custom handlers\n const metadata: LogMetadata = {\n timestamp: timestamp || formatTimestamp(),\n level,\n prefix,\n stackInfo: stackInfo || undefined,\n };\n\n this.handlers.forEach(handler => {\n try {\n handler.handle(level, String(args[0] || ''), args, metadata);\n } catch (error) {\n console.error('Log handler failed:', error);\n }\n });\n }\n\n /**\n * Logs debug information (lowest priority)\n */\n debug(...args: any[]): void {\n this.log('debug', ...args);\n }\n\n /**\n * Logs informational messages\n */\n info(...args: any[]): void {\n this.log('info', ...args);\n }\n\n /**\n * Logs warning messages\n */\n warn(...args: any[]): void {\n this.log('warn', ...args);\n }\n\n /**\n * Logs error messages\n */\n error(...args: any[]): void {\n this.log('error', ...args);\n }\n\n /**\n * Logs critical errors (highest priority)\n */\n critical(...args: any[]): void {\n this.log('critical', ...args);\n }\n\n /**\n * Logs trace information (detailed debugging)\n */\n trace(...args: any[]): void {\n this.log('debug', ...args);\n if (this.shouldLog('debug')) {\n console.trace(...args);\n }\n }\n\n // ===== BASIC ADVANCED FEATURES =====\n\n /**\n * Displays data in a table format\n */\n table(data: any, columns?: string[]): void {\n if (!this.shouldLog('info')) return;\n\n const prefix = this.getEffectivePrefix();\n console.log(`[TABLE]${prefix ? ` [${prefix}]` : ''}:`);\n \n if (columns) {\n console.table(data, columns);\n } else {\n console.table(data);\n }\n }\n\n /**\n * Starts a collapsible group in the console\n */\n group(label: string, collapsed: boolean = false): void {\n const prefix = this.getEffectivePrefix();\n const fullLabel = `${prefix ? `[${prefix}] ` : ''}${label}`;\n \n if (collapsed) {\n console.groupCollapsed(fullLabel);\n } else {\n console.group(fullLabel);\n }\n \n this.groupDepth++;\n }\n\n /**\n * Ends the current console group\n */\n groupEnd(): void {\n if (this.groupDepth > 0) {\n console.groupEnd();\n this.groupDepth--;\n }\n }\n\n /**\n * Starts a timer with the given label\n */\n time(label: string): void {\n const timer: TimerEntry = {\n label,\n startTime: performance.now(),\n };\n this.timers.set(label, timer);\n console.log(`[TIMER] Started: ${label}`);\n }\n\n /**\n * Ends a timer and logs the elapsed time\n */\n timeEnd(label: string): void {\n const timer = this.timers.get(label);\n if (!timer) {\n this.warn(`Timer '${label}' does not exist`);\n return;\n }\n\n const elapsed = performance.now() - timer.startTime;\n this.timers.delete(label);\n console.log(`[TIMER] ${label}: ${elapsed.toFixed(2)}ms`);\n }\n}\n\n// Create and export singleton instance for convenience\nconst coreLogger = new CoreLogger();\n\n/**\n * Export individual methods for convenience (with proper binding)\n */\nexport const debug = (...args: any[]) => coreLogger.debug(...args);\nexport const info = (...args: any[]) => coreLogger.info(...args);\nexport const warn = (...args: any[]) => coreLogger.warn(...args);\nexport const error = (...args: any[]) => coreLogger.error(...args);\nexport const critical = (...args: any[]) => coreLogger.critical(...args);\nexport const trace = (...args: any[]) => coreLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => coreLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => coreLogger.group(label, collapsed);\nexport const groupEnd = () => coreLogger.groupEnd();\nexport const time = (label: string) => coreLogger.time(label);\nexport const timeEnd = (label: string) => coreLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => coreLogger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => coreLogger.createScopedLogger(prefix);\nexport const setVerbosity = (level: Verbosity) => coreLogger.setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => coreLogger.addHandler(handler);\n\n// Export the singleton as default\nexport default coreLogger;\n\n// Re-export core types\nexport type {\n LogLevel,\n Verbosity,\n LoggerConfig,\n ILogHandler,\n LogMetadata\n} from './types/index.js';"],"names":["error"],"mappings":";;AAuCO,MAAM,WAAW;AAAA,EACZ;AAAA,EACA;AAAA,EACA,WAA0B,CAAA;AAAA,EAC1B,6BAAsC,IAAA;AAAA,EACtC,aAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7B,YAAY,SAAgC,IAAI;AAC5C,SAAK,SAAS;AAAA,MACV,GAAG;AAAA,MACH,GAAG;AAAA;AAAA,MAEH,cAAc;AAAA,MACd,kBAAkB,OAAO,oBAAoB;AAAA,MAC7C,kBAAkB,OAAO,oBAAoB;AAAA,IAAA;AAAA,EAErD;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,YAA0B;AACtB,WAAO,EAAE,GAAG,KAAK,OAAA;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA,EAKA,gBAAgB,QAAsB;AAClC,SAAK,OAAO,eAAe;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,OAAwB;AACjC,SAAK,OAAO,YAAY;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAKA,mBAAmB,QAA4B;AAC3C,UAAM,eAAe,IAAI,WAAW,KAAK,MAAM;AAC/C,iBAAa,eAAe;AAC5B,iBAAa,WAAW,CAAC,GAAG,KAAK,QAAQ;AACzC,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW,SAA4B;AACnC,SAAK,SAAS,KAAK,OAAO;AAAA,EAC9B;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B,WAAW,MAAM,GAAG,IAAI;AAC1D,MAAM,QAAQ,CAAC,MAAW,YAAuB,WAAW,MAAM,MAAM,OAAO;AAC/E,MAAM,QAAQ,CAAC,OAAe,cAAwB,WAAW,MAAM,OAAO,SAAS;AACvF,MAAM,WAAW,MAAM,WAAW,SAAA;AAClC,MAAM,OAAO,CAAC,UAAkB,WAAW,KAAK,KAAK;AACrD,MAAM,UAAU,CAAC,UAAkB,WAAW,QAAQ,KAAK;AAC3D,MAAM,kBAAkB,CAAC,WAAmB,WAAW,gBAAgB,MAAM;AAC7E,MAAM,qBAAqB,CAAC,WAAmB,WAAW,mBAAmB,MAAM;AACnF,MAAM,eAAe,CAAC,UAAqB,WAAW,aAAa,KAAK;AACxE,MAAM,aAAa,CAAC,YAAyB,WAAW,WAAW,OAAO;"}
|
package/dist/exports.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Logger-BQhMKy_T.js"),r=require("./chunks/exports-U1xLBXrY.js");class ExportLogger extends e.Logger{exportLogHandler;remoteHandlers=[];constructor(e={}){super(e),e.bufferSize&&(this.exportLogHandler=new r.ExportLogHandler(e.bufferSize),this.addHandler(this.exportLogHandler))}async exportLogs(e,r){if(!this.exportLogHandler)throw new Error("Export handler not initialized. Set bufferSize in constructor.");return JSON.stringify([])}getLogs(){return this.exportLogHandler,[]}clearLogs(){this.exportLogHandler}getLogStats(){return this.exportLogHandler,{}}addRemoteHandler(e,t){const o=new r.RemoteLogHandler(e,t);this.remoteHandlers.push(o),this.addHandler(o)}clearRemoteHandlers(){const e=this.getHandlers();this.remoteHandlers.forEach(r=>{const t=e.indexOf(r);t>-1&&e.splice(t,1)}),this.remoteHandlers=[]}async flushRemoteHandlers(){const e=this.remoteHandlers.map(e=>Promise.resolve());await Promise.all(e)}}const t=new ExportLogger({bufferSize:1e3}),o={exportCSV:async e=>await t.exportLogs("csv",e),exportJSON:async e=>await t.exportLogs("json",e),exportXML:async e=>await t.exportLogs("xml",e),getStats:()=>t.getLogStats(),clear(){t.clearLogs()}},s={addEndpoint(e,r){t.addRemoteHandler(e,r)},clearEndpoints(){t.clearRemoteHandlers()},async flush(){await t.flushRemoteHandlers()}};exports.ExportLogHandler=r.ExportLogHandler,exports.RemoteLogHandler=r.RemoteLogHandler,exports.ExportLogger=ExportLogger,exports.addHandler=e=>t.addHandler(e),exports.addRemoteHandler=(e,r)=>t.addRemoteHandler(e,r),exports.clearLogs=()=>t.clearLogs(),exports.clearRemoteHandlers=()=>t.clearRemoteHandlers(),exports.createScopedLogger=e=>t.createScopedLogger(e),exports.critical=(...e)=>t.critical(...e),exports.debug=(...e)=>t.debug(...e),exports.default=t,exports.error=(...e)=>t.error(...e),exports.exportLogs=async(e,r)=>await t.exportLogs(e,r),exports.exportUtils=o,exports.flushRemoteHandlers=async()=>await t.flushRemoteHandlers(),exports.getLogStats=()=>t.getLogStats(),exports.getLogs=()=>t.getLogs(),exports.group=(e,r)=>t.group(e,r),exports.groupEnd=()=>t.groupEnd(),exports.info=(...e)=>t.info(...e),exports.remoteUtils=s,exports.setGlobalPrefix=e=>t.setGlobalPrefix(e),exports.setVerbosity=e=>t.setVerbosity(e),exports.success=(...e)=>t.success(...e),exports.table=(e,r)=>t.table(e,r),exports.time=e=>t.time(e),exports.timeEnd=e=>t.timeEnd(e),exports.trace=(...e)=>t.trace(...e),exports.warn=(...e)=>t.warn(...e);
|
|
2
|
+
//# sourceMappingURL=exports.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.cjs","sources":["../src/exports-module.ts"],"sourcesContent":["/**\n * @fileoverview Exports Module - Export and remote logging capabilities\n * @version 0.0.1\n * \n * This module provides export functionality for logs including CSV, JSON, XML formats\n * and remote logging capabilities for sending logs to external services.\n */\n\n// Core logger and types\nimport { Logger } from './Logger.js';\nimport type {\n LogLevel,\n Verbosity,\n ILogHandler\n} from './types/index.js';\n\n// Export handlers\nimport {\n ExportLogHandler,\n RemoteLogHandler\n} from './handlers/index.js';\n\n/**\n * Logger with export and remote capabilities\n * \n * @example\n * ```typescript\n * import { ExportLogger } from '@mks2508/better-logger/exports';\n * \n * const logger = new ExportLogger({ bufferSize: 1000 });\n * \n * // Log some data\n * logger.info('User logged in', { userId: 123 });\n * logger.error('Failed to process', { error: 'timeout' });\n * \n * // Export logs\n * const csvData = await logger.exportLogs('csv');\n * const jsonData = await logger.exportLogs('json');\n * \n * // Setup remote logging\n * logger.addRemoteHandler('https://api.myapp.com/logs', 'api-key');\n * ```\n */\nexport class ExportLogger extends Logger {\n private exportLogHandler?: ExportLogHandler;\n private remoteHandlers: RemoteLogHandler[] = [];\n\n constructor(config: { bufferSize?: number } & any = {}) {\n super(config);\n \n // Initialize export handler if buffer size specified\n if (config.bufferSize) {\n this.exportLogHandler = new ExportLogHandler(config.bufferSize);\n this.addHandler(this.exportLogHandler);\n }\n }\n\n /**\n * Export logs in specified format\n * \n * @param format - Export format (csv, json, xml)\n * @param options - Export options\n * @returns Promise resolving to exported data\n * \n * @example\n * ```typescript\n * const csvData = await logger.exportLogs('csv');\n * const jsonData = await logger.exportLogs('json', { \n * filter: { level: 'error' },\n * limit: 100 \n * });\n * ```\n */\n async exportLogs(\n format: 'csv' | 'json' | 'xml', \n options?: {\n filter?: { level?: LogLevel; from?: Date; to?: Date };\n limit?: number;\n }\n ): Promise<string> {\n if (!this.exportLogHandler) {\n throw new Error('Export handler not initialized. Set bufferSize in constructor.');\n }\n\n // Temporary implementation - ExportLogHandler needs these methods\n return JSON.stringify([]);\n }\n\n /**\n * Get current log buffer\n * \n * @returns Array of log entries\n * \n * @example\n * ```typescript\n * const logs = logger.getLogs();\n * console.log(`Buffered ${logs.length} log entries`);\n * ```\n */\n getLogs(): any[] {\n if (!this.exportLogHandler) {\n return [];\n }\n \n // Temporary implementation - ExportLogHandler needs these methods\n return [];\n }\n\n /**\n * Clear the log buffer\n * \n * @example\n * ```typescript\n * logger.clearLogs();\n * ```\n */\n clearLogs(): void {\n if (this.exportLogHandler) {\n // Temporary implementation - ExportLogHandler needs these methods\n }\n }\n\n /**\n * Get log statistics\n * \n * @returns Statistics object with counts by level\n * \n * @example\n * ```typescript\n * const stats = logger.getLogStats();\n * console.log(`Errors: ${stats.error}, Warnings: ${stats.warn}`);\n * ```\n */\n getLogStats(): Record<string, number> {\n if (!this.exportLogHandler) {\n return {};\n }\n\n // Temporary implementation - ExportLogHandler needs these methods\n return {};\n }\n\n /**\n * Add remote logging handler\n * \n * @param endpoint - Remote endpoint URL\n * @param apiKey - Optional API key for authentication\n * \n * @example\n * ```typescript\n * logger.addRemoteHandler('https://logs.myservice.com/api', 'secret-key');\n * ```\n */\n addRemoteHandler(endpoint: string, apiKey?: string): void {\n const remoteHandler = new RemoteLogHandler(endpoint, apiKey);\n this.remoteHandlers.push(remoteHandler);\n this.addHandler(remoteHandler);\n }\n\n /**\n * Remove all remote handlers\n * \n * @example\n * ```typescript\n * logger.clearRemoteHandlers();\n * ```\n */\n clearRemoteHandlers(): void {\n // Remove from handlers array\n const allHandlers = this.getHandlers();\n this.remoteHandlers.forEach(remoteHandler => {\n const index = allHandlers.indexOf(remoteHandler);\n if (index > -1) {\n allHandlers.splice(index, 1);\n }\n });\n \n this.remoteHandlers = [];\n }\n\n /**\n * Flush all remote handlers (force send pending logs)\n * \n * @example\n * ```typescript\n * await logger.flushRemoteHandlers();\n * ```\n */\n async flushRemoteHandlers(): Promise<void> {\n const flushPromises = this.remoteHandlers.map(handler => \n Promise.resolve() // RemoteLogHandler needs flush method\n );\n \n await Promise.all(flushPromises);\n }\n}\n\n// Create singleton instance with export capabilities\nconst exportLogger = new ExportLogger({ bufferSize: 1000 });\n\n/**\n * Export management utilities\n */\nexport const exportUtils = {\n /**\n * Export current logs as CSV\n */\n async exportCSV(options?: any): Promise<string> {\n return await exportLogger.exportLogs('csv', options);\n },\n\n /**\n * Export current logs as JSON\n */\n async exportJSON(options?: any): Promise<string> {\n return await exportLogger.exportLogs('json', options);\n },\n\n /**\n * Export current logs as XML\n */\n async exportXML(options?: any): Promise<string> {\n return await exportLogger.exportLogs('xml', options);\n },\n\n /**\n * Get log statistics\n */\n getStats(): Record<string, number> {\n return exportLogger.getLogStats();\n },\n\n /**\n * Clear all logs\n */\n clear(): void {\n exportLogger.clearLogs();\n }\n};\n\n/**\n * Remote logging utilities\n */\nexport const remoteUtils = {\n /**\n * Add remote logging endpoint\n */\n addEndpoint(url: string, apiKey?: string): void {\n exportLogger.addRemoteHandler(url, apiKey);\n },\n\n /**\n * Clear all remote endpoints\n */\n clearEndpoints(): void {\n exportLogger.clearRemoteHandlers();\n },\n\n /**\n * Flush all remote logs\n */\n async flush(): Promise<void> {\n await exportLogger.flushRemoteHandlers();\n }\n};\n\n/**\n * Export individual logging methods with export capabilities\n */\nexport const debug = (...args: any[]) => exportLogger.debug(...args);\nexport const info = (...args: any[]) => exportLogger.info(...args);\nexport const warn = (...args: any[]) => exportLogger.warn(...args);\nexport const error = (...args: any[]) => exportLogger.error(...args);\nexport const success = (...args: any[]) => exportLogger.success(...args);\nexport const critical = (...args: any[]) => exportLogger.critical(...args);\nexport const trace = (...args: any[]) => exportLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => exportLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => exportLogger.group(label, collapsed);\nexport const groupEnd = () => exportLogger.groupEnd();\nexport const time = (label: string) => exportLogger.time(label);\nexport const timeEnd = (label: string) => exportLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => exportLogger.setGlobalPrefix(prefix);\nexport const createScopedLogger = (prefix: string) => exportLogger.createScopedLogger(prefix);\nexport const setVerbosity = (level: Verbosity) => exportLogger.setVerbosity(level);\nexport const addHandler = (handler: ILogHandler) => exportLogger.addHandler(handler);\n\n/**\n * Export functionality\n */\nexport const exportLogs = async (format: 'csv' | 'json' | 'xml', options?: any) => \n await exportLogger.exportLogs(format, options);\nexport const getLogs = () => exportLogger.getLogs();\nexport const clearLogs = () => exportLogger.clearLogs();\nexport const getLogStats = () => exportLogger.getLogStats();\n\n/**\n * Remote logging functionality\n */\nexport const addRemoteHandler = (endpoint: string, apiKey?: string) => \n exportLogger.addRemoteHandler(endpoint, apiKey);\nexport const clearRemoteHandlers = () => exportLogger.clearRemoteHandlers();\nexport const flushRemoteHandlers = async () => await exportLogger.flushRemoteHandlers();\n\n// Export the singleton as default\nexport default exportLogger;\n\n// Re-export handlers\nexport { ExportLogHandler, RemoteLogHandler } from './handlers/index.js';\n\n// Re-export types\nexport type { ILogHandler } from './types/index.js';"],"names":["ExportLogger","Logger","exportLogHandler","remoteHandlers","constructor","config","super","bufferSize","this","ExportLogHandler","addHandler","exportLogs","format","options","Error","JSON","stringify","getLogs","clearLogs","getLogStats","addRemoteHandler","endpoint","apiKey","remoteHandler","RemoteLogHandler","push","clearRemoteHandlers","allHandlers","getHandlers","forEach","index","indexOf","splice","flushRemoteHandlers","flushPromises","map","handler","Promise","resolve","all","exportLogger","exportUtils","async","getStats","clear","remoteUtils","addEndpoint","url","clearEndpoints","flush","prefix","createScopedLogger","args","critical","debug","error","label","collapsed","group","groupEnd","info","setGlobalPrefix","level","setVerbosity","success","data","columns","table","time","timeEnd","trace","warn"],"mappings":"qMA2CO,MAAMA,qBAAqBC,EAAAA,OACtBC,iBACAC,eAAqC,GAE7C,WAAAC,CAAYC,EAAwC,IAChDC,MAAMD,GAGFA,EAAOE,aACPC,KAAKN,iBAAmB,IAAIO,mBAAiBJ,EAAOE,YACpDC,KAAKE,WAAWF,KAAKN,kBAE7B,CAkBA,gBAAMS,CACFC,EACAC,GAKA,IAAKL,KAAKN,iBACN,MAAM,IAAIY,MAAM,kEAIpB,OAAOC,KAAKC,UAAU,GAC1B,CAaA,OAAAC,GACI,OAAKT,KAAKN,iBAKH,EACX,CAUA,SAAAgB,GACQV,KAAKN,gBAGb,CAaA,WAAAiB,GACI,OAAKX,KAAKN,iBAKH,CAAA,CAC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