@mks2508/better-logger 0.0.2-alpha.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +18 -2
- package/.github/workflows/ci-quality.yml +357 -0
- package/.github/workflows/docs-demo.yml +119 -0
- package/.github/workflows/releases-core.yml +512 -0
- package/.github/workflows/releases-full.yml +582 -0
- package/.github/{workflows → workflows-backup}/ci.yml +12 -110
- package/.github/workflows-backup/nightly.yml +196 -0
- package/.github/workflows-backup/release-optimized.yml +373 -0
- package/.release-notes-0.2.0.md +129 -0
- package/.yamllint +28 -0
- package/CHANGELOG.json +783 -0
- package/CLAUDE.md +92 -1
- package/README.md +198 -490
- package/bun.lock +323 -0
- package/demo.html +9 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/Logger.d.ts +272 -0
- package/dist/Logger.d.ts.map +1 -0
- package/dist/Logger.js +680 -0
- package/dist/ScopedLogger.d.ts +126 -0
- package/dist/ScopedLogger.d.ts.map +1 -0
- package/dist/ScopedLogger.js +234 -0
- package/dist/chunks/Logger-BpeuYIxR.js +2 -0
- package/dist/chunks/Logger-BpeuYIxR.js.map +1 -0
- package/dist/chunks/Logger-Didxtr23.js +3275 -0
- package/dist/chunks/Logger-Didxtr23.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
- package/dist/chunks/environment-Bxbnw4pd.js +544 -0
- package/dist/chunks/environment-Bxbnw4pd.js.map +1 -0
- package/dist/chunks/environment-Dm66zOML.js +4 -0
- package/dist/chunks/environment-Dm66zOML.js.map +1 -0
- package/dist/chunks/formatting-C0riPC5_.js +95 -0
- package/dist/chunks/formatting-C0riPC5_.js.map +1 -0
- package/dist/chunks/formatting-DNCAV66-.js +2 -0
- package/dist/chunks/formatting-DNCAV66-.js.map +1 -0
- package/dist/cli/CommandProcessor.d.ts +103 -0
- package/dist/cli/CommandProcessor.d.ts.map +1 -0
- package/dist/cli/CommandProcessor.js +184 -0
- package/dist/cli/commands/ConfigCommand.d.ts +17 -0
- package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
- package/dist/cli/commands/ConfigCommand.js +88 -0
- package/dist/cli/commands/ExportCommand.d.ts +51 -0
- package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
- package/dist/cli/commands/ExportCommand.js +243 -0
- package/dist/cli/commands/HistoryCommand.d.ts +50 -0
- package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
- package/dist/cli/commands/HistoryCommand.js +96 -0
- package/dist/cli/commands/StatusCommand.d.ts +33 -0
- package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
- package/dist/cli/commands/StatusCommand.js +93 -0
- package/dist/cli/commands/ThemeCommand.d.ts +33 -0
- package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
- package/dist/cli/commands/ThemeCommand.js +79 -0
- package/dist/cli/help.d.ts +15 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +118 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +46 -0
- package/dist/constants.d.ts +122 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +159 -0
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +134 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +315 -242
- package/dist/core.js.map +1 -1
- package/dist/example.d.ts +18 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +154 -0
- package/dist/exports-module.d.ts +203 -0
- package/dist/exports-module.d.ts.map +1 -0
- package/dist/exports-module.js +260 -0
- package/dist/exports.cjs +1 -1
- package/dist/exports.cjs.map +1 -1
- package/dist/exports.js +5 -4
- package/dist/exports.js.map +1 -1
- package/dist/handlers/AnalyticsLogHandler.d.ts +11 -0
- package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
- package/dist/handlers/AnalyticsLogHandler.js +19 -0
- package/dist/handlers/ExportLogHandler.d.ts +103 -0
- package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
- package/dist/handlers/ExportLogHandler.js +516 -0
- package/dist/handlers/FileLogHandler.d.ts +36 -0
- package/dist/handlers/FileLogHandler.d.ts.map +1 -0
- package/dist/handlers/FileLogHandler.js +156 -0
- package/dist/handlers/RemoteLogHandler.d.ts +14 -0
- package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
- package/dist/handlers/RemoteLogHandler.js +37 -0
- package/dist/handlers/index.d.ts +8 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +7 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +86 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +89 -103
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +139 -0
- package/dist/styling/LogStyleBuilder.d.ts +149 -0
- package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
- package/dist/styling/LogStyleBuilder.js +289 -0
- package/dist/styling/SemanticStyles.d.ts +181 -0
- package/dist/styling/SemanticStyles.d.ts.map +1 -0
- package/dist/styling/SemanticStyles.js +339 -0
- package/dist/styling/SmartPresets.d.ts +25 -0
- package/dist/styling/SmartPresets.d.ts.map +1 -0
- package/dist/styling/SmartPresets.js +276 -0
- package/dist/styling/StyleBuilder.d.ts +140 -0
- package/dist/styling/StyleBuilder.d.ts.map +1 -0
- package/dist/styling/StyleBuilder.js +280 -0
- package/dist/styling/banners.d.ts +45 -0
- package/dist/styling/banners.d.ts.map +1 -0
- package/dist/styling/banners.js +155 -0
- package/dist/styling/index.d.ts +10 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +9 -0
- package/dist/styling/themes.d.ts +10 -0
- package/dist/styling/themes.d.ts.map +1 -0
- package/dist/styling/themes.js +231 -0
- package/dist/styling-module.d.ts +185 -0
- package/dist/styling-module.d.ts.map +1 -0
- package/dist/styling-module.js +199 -0
- package/dist/styling.cjs +1 -1
- package/dist/styling.cjs.map +1 -1
- package/dist/styling.js +6 -6
- package/dist/styling.js.map +1 -1
- package/dist/types/Logger.d.ts +268 -0
- package/dist/types/Logger.d.ts.map +1 -0
- package/dist/types/ScopedLogger.d.ts +123 -0
- package/dist/types/ScopedLogger.d.ts.map +1 -0
- package/dist/types/cli/CommandProcessor.d.ts +100 -0
- package/dist/types/cli/CommandProcessor.d.ts.map +1 -0
- package/dist/types/cli/commands/ConfigCommand.d.ts +14 -0
- package/dist/types/cli/commands/ConfigCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/ExportCommand.d.ts +48 -0
- package/dist/types/cli/commands/ExportCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/HistoryCommand.d.ts +47 -0
- package/dist/types/cli/commands/HistoryCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/StatusCommand.d.ts +30 -0
- package/dist/types/cli/commands/StatusCommand.d.ts.map +1 -0
- package/dist/types/cli/commands/ThemeCommand.d.ts +30 -0
- package/dist/types/cli/commands/ThemeCommand.d.ts.map +1 -0
- package/dist/types/cli/help.d.ts +12 -0
- package/dist/types/cli/help.d.ts.map +1 -0
- package/dist/types/cli/index.d.ts +15 -0
- package/dist/types/cli/index.d.ts.map +1 -0
- package/dist/types/constants.d.ts +119 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/core.d.ts +125 -211
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +13 -0
- package/dist/types/example.d.ts +18 -0
- package/dist/types/example.d.ts.map +1 -0
- package/dist/types/exports-module.d.ts +196 -0
- package/dist/types/exports-module.d.ts.map +1 -0
- package/dist/types/handlers/AnalyticsLogHandler.d.ts +8 -0
- package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/ExportLogHandler.d.ts +100 -0
- package/dist/types/handlers/ExportLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/FileLogHandler.d.ts +33 -0
- package/dist/types/handlers/FileLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/RemoteLogHandler.d.ts +11 -0
- package/dist/types/handlers/RemoteLogHandler.d.ts.map +1 -0
- package/dist/types/handlers/index.d.ts +8 -0
- package/dist/types/handlers/index.d.ts.map +1 -0
- package/dist/types/handlers.d.ts +88 -0
- package/dist/types/handlers.d.ts.map +1 -0
- package/dist/types/handlers.js +4 -0
- package/dist/types/index.d.ts +7 -675
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/main.d.ts +2 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/styling/LogStyleBuilder.d.ts +146 -0
- package/dist/types/styling/LogStyleBuilder.d.ts.map +1 -0
- package/dist/types/styling/SemanticStyles.d.ts +178 -0
- package/dist/types/styling/SemanticStyles.d.ts.map +1 -0
- package/dist/types/styling/SmartPresets.d.ts +22 -0
- package/dist/types/styling/SmartPresets.d.ts.map +1 -0
- package/dist/types/styling/StyleBuilder.d.ts +140 -0
- package/dist/types/styling/StyleBuilder.d.ts.map +1 -0
- package/dist/types/styling/banners.d.ts +42 -0
- package/dist/types/styling/banners.d.ts.map +1 -0
- package/dist/types/styling/index.d.ts +10 -0
- package/dist/types/styling/index.d.ts.map +1 -0
- package/dist/types/styling/themes.d.ts +7 -0
- package/dist/types/styling/themes.d.ts.map +1 -0
- package/dist/types/styling-module.d.ts +178 -0
- package/dist/types/styling-module.d.ts.map +1 -0
- package/dist/types/types/core.d.ts +125 -0
- package/dist/types/types/core.d.ts.map +1 -0
- package/dist/types/types/handlers.d.ts +85 -0
- package/dist/types/types/handlers.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +7 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/environment.d.ts +47 -0
- package/dist/types/utils/environment.d.ts.map +1 -0
- package/dist/types/utils/formatting.d.ts +37 -0
- package/dist/types/utils/formatting.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/opentui-detection.d.ts +34 -0
- package/dist/types/utils/opentui-detection.d.ts.map +1 -0
- package/dist/types/utils/output.d.ts +41 -0
- package/dist/types/utils/output.d.ts.map +1 -0
- package/dist/types/utils/stackTrace.d.ts +6 -0
- package/dist/types/utils/stackTrace.d.ts.map +1 -0
- package/dist/types/utils/timestamps.d.ts +20 -0
- package/dist/types/utils/timestamps.d.ts.map +1 -0
- package/dist/utils/environment.d.ts +47 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +85 -0
- package/dist/utils/formatting.d.ts +40 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +117 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/opentui-detection.d.ts +34 -0
- package/dist/utils/opentui-detection.d.ts.map +1 -0
- package/dist/utils/opentui-detection.js +116 -0
- package/dist/utils/output.d.ts +44 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +150 -0
- package/dist/utils/stackTrace.d.ts +9 -0
- package/dist/utils/stackTrace.d.ts.map +1 -0
- package/dist/utils/stackTrace.js +81 -0
- package/dist/utils/timestamps.d.ts +20 -0
- package/dist/utils/timestamps.d.ts.map +1 -0
- package/dist/utils/timestamps.js +71 -0
- package/docs/API.md +691 -0
- package/docs/CORE.md +10 -10
- package/docs/DEVELOPMENT.md +731 -0
- package/docs/PACKAGES.md +244 -0
- package/docs/_config.yml +36 -0
- package/docs/index.md +179 -0
- package/examples/README.md +208 -0
- package/examples/basic-logging.js +75 -0
- package/examples/data-export.js +234 -0
- package/examples/package.json +16 -0
- package/examples/performance-timing.js +170 -0
- package/examples/simplified-api.js +124 -0
- package/examples/styling-themes.js +207 -0
- package/package.json +37 -21
- package/packages/core/package.json +57 -0
- package/packages/exports/package.json +41 -0
- package/packages/nodejs-opentui/README.md +232 -0
- package/packages/nodejs-opentui/package.json +72 -0
- package/packages/nodejs-opentui/src/LogRenderer.ts +171 -0
- package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +178 -0
- package/packages/nodejs-opentui/src/components/LogBadge.tsx +131 -0
- package/packages/nodejs-opentui/src/index.ts +133 -0
- package/packages/nodejs-opentui/src/types.ts +158 -0
- package/packages/nodejs-opentui/tsconfig.json +20 -0
- package/packages/styling/package.json +41 -0
- package/project-utils/README.md +172 -0
- package/project-utils/auto-release-gemini.ts +1193 -0
- package/project-utils/auto-release-ui.ts +1329 -0
- package/project-utils/commit-generator.ts +1385 -0
- package/project-utils/commit-ui.ts +264 -0
- package/project-utils/git-utils.ts +199 -0
- package/project-utils/github-release-manager.ts +466 -0
- package/project-utils/project-config.ts +260 -0
- package/project-utils/prompt-templates.js +345 -0
- package/project-utils/prompt-templates.ts +422 -0
- package/project-utils/version-manager.ts +1078 -0
- package/src/Logger.ts +251 -16
- package/src/ScopedLogger.ts +262 -0
- package/src/cli/CommandProcessor.ts +173 -2
- package/src/cli/commands/HistoryCommand.ts +117 -0
- package/src/cli/index.ts +12 -0
- package/src/constants.ts +84 -2
- package/src/core.ts +119 -46
- package/src/example.ts +4 -4
- package/src/exports-module.ts +1 -1
- package/src/handlers/ExportLogHandler.ts +141 -0
- package/src/handlers/FileLogHandler.ts +144 -5
- package/src/index.ts +1 -1
- package/src/main.ts +3 -3
- package/src/styling/LogStyleBuilder.ts +355 -0
- package/src/styling/SemanticStyles.ts +380 -0
- package/src/styling/SmartPresets.ts +288 -0
- package/src/styling/StyleBuilder.ts +14 -0
- package/src/styling/index.ts +16 -1
- package/src/styling-module.ts +1 -1
- package/src/types/core.ts +60 -0
- package/src/types/index.ts +6 -0
- package/src/utils/environment.ts +94 -0
- package/src/utils/formatting.ts +142 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/opentui-detection.ts +138 -0
- package/src/utils/output.ts +66 -8
- package/test-core-browser.html +237 -0
- package/test-core-node.js +63 -0
- package/tests/test-conflict-resolution.ts +391 -0
- package/tests/validate-workflows.sh +131 -0
- package/tests/yaml-autofix.sh +146 -0
- package/vite.config.ts +189 -50
- package/.npmrc.bak +0 -1
- package/dist/chunks/Logger-BQhMKy_T.js +0 -2
- package/dist/chunks/Logger-BQhMKy_T.js.map +0 -1
- package/dist/chunks/Logger-BrFKFZcD.js +0 -978
- package/dist/chunks/Logger-BrFKFZcD.js.map +0 -1
- package/dist/chunks/core-2opW4Pi3.js +0 -194
- package/dist/chunks/core-2opW4Pi3.js.map +0 -1
- package/dist/chunks/core-DyugwSYZ.js +0 -4
- package/dist/chunks/core-DyugwSYZ.js.map +0 -1
- package/dist/chunks/exports-BNP3R7dp.js +0 -421
- package/dist/chunks/exports-BNP3R7dp.js.map +0 -1
- package/dist/chunks/exports-U1xLBXrY.js +0 -2
- package/dist/chunks/exports-U1xLBXrY.js.map +0 -1
- package/dist/chunks/styling-DhUDzwlE.js +0 -654
- package/dist/chunks/styling-DhUDzwlE.js.map +0 -1
- package/dist/chunks/styling-tmRDI28D.js +0 -2
- package/dist/chunks/styling-tmRDI28D.js.map +0 -1
- package/dist/types/exports.d.ts +0 -600
- package/dist/types/styling.d.ts +0 -751
- package/src/Logger.ts.backup +0 -1684
- /package/.github/{workflows → workflows-backup}/release.yml +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Styling Module - Advanced visual features for Better Logger
|
|
3
|
+
* @version 0.0.1
|
|
4
|
+
*
|
|
5
|
+
* This module provides advanced styling features including SVG support, CSS animations,
|
|
6
|
+
* themed banners, and visual enhancements for console logging.
|
|
7
|
+
*/
|
|
8
|
+
// Import core logger
|
|
9
|
+
import { Logger } from './Logger.js';
|
|
10
|
+
// Styling imports
|
|
11
|
+
import { StyleBuilder, StylePresets, THEME_PRESETS, displayInitBanner, BANNER_VARIANTS } from './styling/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* Enhanced Logger with advanced styling capabilities
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { StyledLogger } from '@mks2508/better-logger/styling';
|
|
18
|
+
*
|
|
19
|
+
* const logger = new StyledLogger();
|
|
20
|
+
* logger.setTheme('neon');
|
|
21
|
+
* logger.logAnimated('🌟 Animated message!');
|
|
22
|
+
* logger.logWithSVG('Custom SVG Logo', svgContent);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class StyledLogger extends Logger {
|
|
26
|
+
/**
|
|
27
|
+
* Log with SVG background image
|
|
28
|
+
*
|
|
29
|
+
* @param message - The message to log
|
|
30
|
+
* @param svgContent - SVG content as string (optional)
|
|
31
|
+
* @param options - Styling options
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* logger.logWithSVG('My App', '<svg>...</svg>', {
|
|
36
|
+
* width: 400,
|
|
37
|
+
* height: 80,
|
|
38
|
+
* padding: '40px 200px'
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
logWithSVG(message, svgContent, options = {}) {
|
|
43
|
+
super.logWithSVG(message, svgContent, options);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Log with animated background gradient
|
|
47
|
+
*
|
|
48
|
+
* @param message - The message to log
|
|
49
|
+
* @param duration - Animation duration in seconds
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* logger.logAnimated('🚀 Loading...', 2);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
logAnimated(message, duration = 3) {
|
|
57
|
+
super.logAnimated(message, duration);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Display banner with specified type
|
|
61
|
+
*
|
|
62
|
+
* @param bannerType - Type of banner to display
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* logger.showBanner('animated');
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
showBanner(bannerType) {
|
|
70
|
+
super.showBanner(bannerType);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Set banner type for initialization display
|
|
74
|
+
*
|
|
75
|
+
* @param bannerType - Type of banner to display
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* logger.setBannerType('svg');
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
setBannerType(bannerType) {
|
|
83
|
+
super.setBannerType(bannerType);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Sets the logger theme with visual banner
|
|
87
|
+
*
|
|
88
|
+
* @param theme - Theme variant to apply
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* logger.setTheme('cyberpunk'); // Shows themed banner
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
setTheme(theme) {
|
|
96
|
+
super.setTheme(theme);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Create singleton instance
|
|
100
|
+
const styledLogger = new StyledLogger();
|
|
101
|
+
/**
|
|
102
|
+
* Utility functions for creating custom styles
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';
|
|
107
|
+
*
|
|
108
|
+
* const myStyle = createStyle()
|
|
109
|
+
* .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
|
|
110
|
+
* .color('white')
|
|
111
|
+
* .padding('10px')
|
|
112
|
+
* .build();
|
|
113
|
+
*
|
|
114
|
+
* console.log('%cCustom Message', myStyle);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export const createStyle = () => new StyleBuilder();
|
|
118
|
+
/**
|
|
119
|
+
* Pre-built style presets
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* import { stylePresets } from '@mks2508/better-logger/styling';
|
|
124
|
+
*
|
|
125
|
+
* console.log('%cSuccess!', stylePresets.success);
|
|
126
|
+
* console.log('%cError!', stylePresets.error);
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export const stylePresets = {
|
|
130
|
+
success: StylePresets.success().build(),
|
|
131
|
+
error: StylePresets.error().build(),
|
|
132
|
+
warning: StylePresets.warning().build(),
|
|
133
|
+
info: StylePresets.info().build(),
|
|
134
|
+
accent: StylePresets.accent().build(),
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Available themes for the logger
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* import { themes } from '@mks2508/better-logger/styling';
|
|
142
|
+
*
|
|
143
|
+
* console.log('Available themes:', Object.keys(themes));
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export const themes = Object.keys(THEME_PRESETS);
|
|
147
|
+
/**
|
|
148
|
+
* Available banner types
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* import { bannerTypes } from '@mks2508/better-logger/styling';
|
|
153
|
+
*
|
|
154
|
+
* console.log('Available banners:', bannerTypes);
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
export const bannerTypes = Object.keys(BANNER_VARIANTS);
|
|
158
|
+
/**
|
|
159
|
+
* Display initialization banner
|
|
160
|
+
*
|
|
161
|
+
* @param bannerType - Type of banner to display
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* import { showInitBanner } from '@mks2508/better-logger/styling';
|
|
166
|
+
*
|
|
167
|
+
* showInitBanner('animated');
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export const showInitBanner = (bannerType) => {
|
|
171
|
+
displayInitBanner(bannerType);
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Export individual styled logging methods
|
|
175
|
+
*/
|
|
176
|
+
export const debug = (...args) => styledLogger.debug(...args);
|
|
177
|
+
export const info = (...args) => styledLogger.info(...args);
|
|
178
|
+
export const warn = (...args) => styledLogger.warn(...args);
|
|
179
|
+
export const error = (...args) => styledLogger.error(...args);
|
|
180
|
+
export const success = (...args) => styledLogger.success(...args);
|
|
181
|
+
export const critical = (...args) => styledLogger.critical(...args);
|
|
182
|
+
export const trace = (...args) => styledLogger.trace(...args);
|
|
183
|
+
export const table = (data, columns) => styledLogger.table(data, columns);
|
|
184
|
+
export const group = (label, collapsed) => styledLogger.group(label, collapsed);
|
|
185
|
+
export const groupEnd = () => styledLogger.groupEnd();
|
|
186
|
+
export const time = (label) => styledLogger.time(label);
|
|
187
|
+
export const timeEnd = (label) => styledLogger.timeEnd(label);
|
|
188
|
+
export const setGlobalPrefix = (prefix) => styledLogger.setGlobalPrefix(prefix);
|
|
189
|
+
export const scope = (prefix) => styledLogger.scope(prefix);
|
|
190
|
+
export const setVerbosity = (level) => styledLogger.setVerbosity(level);
|
|
191
|
+
export const setTheme = (theme) => styledLogger.setTheme(theme);
|
|
192
|
+
export const setBannerType = (bannerType) => styledLogger.setBannerType(bannerType);
|
|
193
|
+
export const showBanner = (bannerType) => styledLogger.showBanner(bannerType);
|
|
194
|
+
export const logWithSVG = (message, svgContent, options) => styledLogger.logWithSVG(message, svgContent, options);
|
|
195
|
+
export const logAnimated = (message, duration) => styledLogger.logAnimated(message, duration);
|
|
196
|
+
// Export the singleton as default
|
|
197
|
+
export default styledLogger;
|
|
198
|
+
// Re-export styling utilities
|
|
199
|
+
export { StyleBuilder, StylePresets, THEME_PRESETS, THEME_BANNERS, BANNER_VARIANTS } from './styling/index.js';
|
package/dist/styling.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Logger-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./chunks/Logger-BpeuYIxR.js"),t=require("./chunks/environment-Dm66zOML.js");class StyledLogger extends e.Logger{logWithSVG(e,t,s={}){super.logWithSVG(e,t,s)}logAnimated(e,t=3){super.logAnimated(e,t)}showBanner(e){super.showBanner(e)}setBannerType(e){super.setBannerType(e)}setTheme(e){super.setTheme(e)}}const s=new StyledLogger,r={success:t.StylePresets.success().build(),error:t.StylePresets.error().build(),warning:t.StylePresets.warning().build(),info:t.StylePresets.info().build(),accent:t.StylePresets.accent().build()},o=Object.keys(e.THEME_PRESETS),n=Object.keys(e.BANNER_VARIANTS);exports.BANNER_VARIANTS=e.BANNER_VARIANTS,exports.THEME_BANNERS=e.THEME_BANNERS,exports.THEME_PRESETS=e.THEME_PRESETS,exports.StyleBuilder=t.StyleBuilder,exports.StylePresets=t.StylePresets,exports.StyledLogger=StyledLogger,exports.bannerTypes=n,exports.createStyle=()=>new t.StyleBuilder,exports.critical=(...e)=>s.critical(...e),exports.debug=(...e)=>s.debug(...e),exports.default=s,exports.error=(...e)=>s.error(...e),exports.group=(e,t)=>s.group(e,t),exports.groupEnd=()=>s.groupEnd(),exports.info=(...e)=>s.info(...e),exports.logAnimated=(e,t)=>s.logAnimated(e,t),exports.logWithSVG=(e,t,r)=>s.logWithSVG(e,t,r),exports.scope=e=>s.scope(e),exports.setBannerType=e=>s.setBannerType(e),exports.setGlobalPrefix=e=>s.setGlobalPrefix(e),exports.setTheme=e=>s.setTheme(e),exports.setVerbosity=e=>s.setVerbosity(e),exports.showBanner=e=>s.showBanner(e),exports.showInitBanner=t=>{e.displayInitBanner(t)},exports.stylePresets=r,exports.success=(...e)=>s.success(...e),exports.table=(e,t)=>s.table(e,t),exports.themes=o,exports.time=e=>s.time(e),exports.timeEnd=e=>s.timeEnd(e),exports.trace=(...e)=>s.trace(...e),exports.warn=(...e)=>s.warn(...e);
|
|
2
2
|
//# sourceMappingURL=styling.cjs.map
|
package/dist/styling.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styling.cjs","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const
|
|
1
|
+
{"version":3,"file":"styling.cjs","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const scope = (prefix: string) => styledLogger.scope(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":["StyledLogger","Logger","logWithSVG","message","svgContent","options","super","logAnimated","duration","showBanner","bannerType","setBannerType","setTheme","theme","styledLogger","stylePresets","success","StylePresets","build","error","warning","info","accent","themes","Object","keys","THEME_PRESETS","bannerTypes","BANNER_VARIANTS","StyleBuilder","args","critical","debug","label","collapsed","group","groupEnd","prefix","scope","setGlobalPrefix","level","setVerbosity","displayInitBanner","data","columns","table","time","timeEnd","trace","warn"],"mappings":"yMAyCO,MAAMA,qBAAqBC,EAAAA,OAiB9B,UAAAC,CAAWC,EAAiBC,EAAqBC,EAAwB,CAAA,GACrEC,MAAMJ,WAAWC,EAASC,EAAYC,EAC1C,CAaA,WAAAE,CAAYJ,EAAiBK,EAAmB,GAC5CF,MAAMC,YAAYJ,EAASK,EAC/B,CAYA,UAAAC,CAAWC,GACPJ,MAAMG,WAAWC,EACrB,CAYA,aAAAC,CAAcD,GACVJ,MAAMK,cAAcD,EACxB,CAYA,QAAAE,CAASC,GACLP,MAAMM,SAASC,EACnB,EAIJ,MAAMC,EAAe,IAAId,aA+BZe,EAAe,CACxBC,QAASC,EAAAA,aAAaD,UAAUE,QAChCC,MAAOF,EAAAA,aAAaE,QAAQD,QAC5BE,QAASH,EAAAA,aAAaG,UAAUF,QAChCG,KAAMJ,EAAAA,aAAaI,OAAOH,QAC1BI,OAAQL,EAAAA,aAAaK,SAASJ,SAarBK,EAASC,OAAOC,KAAKC,EAAAA,eAYrBC,EAAcH,OAAOC,KAAKG,EAAAA,2RA3CZ,IAAM,IAAIC,EAAAA,8BAqEb,IAAIC,IAAgBhB,EAAaiB,YAAYD,iBALhD,IAAIA,IAAgBhB,EAAakB,SAASF,mCAG1C,IAAIA,IAAgBhB,EAAaK,SAASW,iBAK1C,CAACG,EAAeC,IAAwBpB,EAAaqB,MAAMF,EAAOC,oBAC/D,IAAMpB,EAAasB,wBARvB,IAAIN,IAAgBhB,EAAaO,QAAQS,uBAmBlC,CAAC3B,EAAiBK,IACzCM,EAAaP,YAAYJ,EAASK,sBAHZ,CAACL,EAAiBC,EAAqBC,IAC7DS,EAAaZ,WAAWC,EAASC,EAAYC,iBAN3BgC,GAAmBvB,EAAawB,MAAMD,yBAG9B3B,GAA2BI,EAAaH,cAAcD,2BAJpD2B,GAAmBvB,EAAayB,gBAAgBF,oBAGvDxB,GAAwBC,EAAaF,SAASC,wBAD1C2B,GAAe1B,EAAa2B,aAAaD,sBAG3C9B,GAA4BI,EAAaL,WAAWC,0BAxBhDA,IAC3BgC,EAAAA,kBAAkBhC,2CAUC,IAAIoB,IAAgBhB,EAAaE,WAAWc,iBAG9C,CAACa,EAAWC,IAAuB9B,EAAa+B,MAAMF,EAAMC,iCAG5DX,GAAkBnB,EAAagC,KAAKb,mBACjCA,GAAkBnB,EAAaiC,QAAQd,iBAL1C,IAAIH,IAAgBhB,EAAakC,SAASlB,gBAJ3C,IAAIA,IAAgBhB,EAAamC,QAAQnB"}
|
package/dist/styling.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as Logger } from "./chunks/Logger-
|
|
2
|
-
import { a
|
|
3
|
-
import { b } from "./chunks/
|
|
1
|
+
import { L as Logger, T as THEME_PRESETS, B as BANNER_VARIANTS, d as displayInitBanner } from "./chunks/Logger-Didxtr23.js";
|
|
2
|
+
import { a } from "./chunks/Logger-Didxtr23.js";
|
|
3
|
+
import { S as StylePresets, b as StyleBuilder } from "./chunks/environment-Bxbnw4pd.js";
|
|
4
4
|
class StyledLogger extends Logger {
|
|
5
5
|
/**
|
|
6
6
|
* Log with SVG background image
|
|
@@ -102,7 +102,7 @@ const groupEnd = () => styledLogger.groupEnd();
|
|
|
102
102
|
const time = (label) => styledLogger.time(label);
|
|
103
103
|
const timeEnd = (label) => styledLogger.timeEnd(label);
|
|
104
104
|
const setGlobalPrefix = (prefix) => styledLogger.setGlobalPrefix(prefix);
|
|
105
|
-
const
|
|
105
|
+
const scope = (prefix) => styledLogger.scope(prefix);
|
|
106
106
|
const setVerbosity = (level) => styledLogger.setVerbosity(level);
|
|
107
107
|
const setTheme = (theme) => styledLogger.setTheme(theme);
|
|
108
108
|
const setBannerType = (bannerType) => styledLogger.setBannerType(bannerType);
|
|
@@ -114,10 +114,9 @@ export {
|
|
|
114
114
|
StyleBuilder,
|
|
115
115
|
StylePresets,
|
|
116
116
|
StyledLogger,
|
|
117
|
-
|
|
117
|
+
a as THEME_BANNERS,
|
|
118
118
|
THEME_PRESETS,
|
|
119
119
|
bannerTypes,
|
|
120
|
-
createScopedLogger,
|
|
121
120
|
createStyle,
|
|
122
121
|
critical,
|
|
123
122
|
debug,
|
|
@@ -128,6 +127,7 @@ export {
|
|
|
128
127
|
info,
|
|
129
128
|
logAnimated,
|
|
130
129
|
logWithSVG,
|
|
130
|
+
scope,
|
|
131
131
|
setBannerType,
|
|
132
132
|
setGlobalPrefix,
|
|
133
133
|
setTheme,
|
package/dist/styling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styling.js","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const
|
|
1
|
+
{"version":3,"file":"styling.js","sources":["../src/styling-module.ts"],"sourcesContent":["/**\n * @fileoverview Styling Module - Advanced visual features for Better Logger\n * @version 0.0.1\n * \n * This module provides advanced styling features including SVG support, CSS animations,\n * themed banners, and visual enhancements for console logging.\n */\n\n// Import core logger\nimport { Logger } from './Logger.js';\n\n// Styling imports\nimport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n displayInitBanner,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Types\nimport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';\n\n/**\n * Enhanced Logger with advanced styling capabilities\n * \n * @example\n * ```typescript\n * import { StyledLogger } from '@mks2508/better-logger/styling';\n * \n * const logger = new StyledLogger();\n * logger.setTheme('neon');\n * logger.logAnimated('🌟 Animated message!');\n * logger.logWithSVG('Custom SVG Logo', svgContent);\n * ```\n */\nexport class StyledLogger extends Logger {\n /**\n * Log with SVG background image\n * \n * @param message - The message to log\n * @param svgContent - SVG content as string (optional)\n * @param options - Styling options\n * \n * @example\n * ```typescript\n * logger.logWithSVG('My App', '<svg>...</svg>', {\n * width: 400,\n * height: 80,\n * padding: '40px 200px'\n * });\n * ```\n */\n logWithSVG(message: string, svgContent?: string, options: StyleOptions = {}): void {\n super.logWithSVG(message, svgContent, options);\n }\n\n /**\n * Log with animated background gradient\n * \n * @param message - The message to log \n * @param duration - Animation duration in seconds\n * \n * @example\n * ```typescript\n * logger.logAnimated('🚀 Loading...', 2);\n * ```\n */\n logAnimated(message: string, duration: number = 3): void {\n super.logAnimated(message, duration);\n }\n\n /**\n * Display banner with specified type\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.showBanner('animated');\n * ```\n */\n showBanner(bannerType?: BannerType): void {\n super.showBanner(bannerType);\n }\n\n /**\n * Set banner type for initialization display\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * logger.setBannerType('svg');\n * ```\n */\n setBannerType(bannerType: BannerType): void {\n super.setBannerType(bannerType);\n }\n\n /**\n * Sets the logger theme with visual banner\n * \n * @param theme - Theme variant to apply\n * \n * @example\n * ```typescript\n * logger.setTheme('cyberpunk'); // Shows themed banner\n * ```\n */\n setTheme(theme: ThemeVariant): void {\n super.setTheme(theme);\n }\n}\n\n// Create singleton instance\nconst styledLogger = new StyledLogger();\n\n/**\n * Utility functions for creating custom styles\n * \n * @example\n * ```typescript\n * import { createStyle, StyleBuilder } from '@mks2508/better-logger/styling';\n * \n * const myStyle = createStyle()\n * .bg('linear-gradient(45deg, #ff6b6b, #feca57)')\n * .color('white')\n * .padding('10px')\n * .build();\n * \n * console.log('%cCustom Message', myStyle);\n * ```\n */\nexport const createStyle = () => new StyleBuilder();\n\n/**\n * Pre-built style presets\n * \n * @example\n * ```typescript\n * import { stylePresets } from '@mks2508/better-logger/styling';\n * \n * console.log('%cSuccess!', stylePresets.success);\n * console.log('%cError!', stylePresets.error);\n * ```\n */\nexport const stylePresets = {\n success: StylePresets.success().build(),\n error: StylePresets.error().build(),\n warning: StylePresets.warning().build(),\n info: StylePresets.info().build(),\n accent: StylePresets.accent().build(),\n};\n\n/**\n * Available themes for the logger\n * \n * @example\n * ```typescript\n * import { themes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available themes:', Object.keys(themes));\n * ```\n */\nexport const themes = Object.keys(THEME_PRESETS);\n\n/**\n * Available banner types\n * \n * @example\n * ```typescript\n * import { bannerTypes } from '@mks2508/better-logger/styling';\n * \n * console.log('Available banners:', bannerTypes);\n * ```\n */\nexport const bannerTypes = Object.keys(BANNER_VARIANTS);\n\n/**\n * Display initialization banner\n * \n * @param bannerType - Type of banner to display\n * \n * @example\n * ```typescript\n * import { showInitBanner } from '@mks2508/better-logger/styling';\n * \n * showInitBanner('animated');\n * ```\n */\nexport const showInitBanner = (bannerType?: BannerType) => {\n displayInitBanner(bannerType);\n};\n\n/**\n * Export individual styled logging methods\n */\nexport const debug = (...args: any[]) => styledLogger.debug(...args);\nexport const info = (...args: any[]) => styledLogger.info(...args);\nexport const warn = (...args: any[]) => styledLogger.warn(...args);\nexport const error = (...args: any[]) => styledLogger.error(...args);\nexport const success = (...args: any[]) => styledLogger.success(...args);\nexport const critical = (...args: any[]) => styledLogger.critical(...args);\nexport const trace = (...args: any[]) => styledLogger.trace(...args);\nexport const table = (data: any, columns?: string[]) => styledLogger.table(data, columns);\nexport const group = (label: string, collapsed?: boolean) => styledLogger.group(label, collapsed);\nexport const groupEnd = () => styledLogger.groupEnd();\nexport const time = (label: string) => styledLogger.time(label);\nexport const timeEnd = (label: string) => styledLogger.timeEnd(label);\nexport const setGlobalPrefix = (prefix: string) => styledLogger.setGlobalPrefix(prefix);\nexport const scope = (prefix: string) => styledLogger.scope(prefix);\nexport const setVerbosity = (level: any) => styledLogger.setVerbosity(level);\nexport const setTheme = (theme: ThemeVariant) => styledLogger.setTheme(theme);\nexport const setBannerType = (bannerType: BannerType) => styledLogger.setBannerType(bannerType);\nexport const showBanner = (bannerType?: BannerType) => styledLogger.showBanner(bannerType);\nexport const logWithSVG = (message: string, svgContent?: string, options?: StyleOptions) => \n styledLogger.logWithSVG(message, svgContent, options);\nexport const logAnimated = (message: string, duration?: number) => \n styledLogger.logAnimated(message, duration);\n\n// Export the singleton as default\nexport default styledLogger;\n\n// Re-export styling utilities\nexport {\n StyleBuilder,\n StylePresets,\n THEME_PRESETS,\n THEME_BANNERS,\n BANNER_VARIANTS\n} from './styling/index.js';\n\n// Re-export types\nexport type {\n ThemeVariant,\n BannerType,\n StyleOptions\n} from './types/index.js';"],"names":[],"mappings":";;;AAyCO,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AgB,aAAa,KAAK,GAAG,IAAI;AAC1D,MAAM,QAAQ,IAAI,SAAgB,aAAa,MAAM,GAAG,IAAI;AAC5D,MAAM,UAAU,IAAI,SAAgB,aAAa,QAAQ,GAAG,IAAI;AAChE,MAAM,WAAW,IAAI,SAAgB,aAAa,SAAS,GAAG,IAAI;AAClE,MAAM,QAAQ,IAAI,SAAgB,aAAa,MAAM,GAAG,IAAI;AAC5D,MAAM,QAAQ,CAAC,MAAW,YAAuB,aAAa,MAAM,MAAM,OAAO;AACjF,MAAM,QAAQ,CAAC,OAAe,cAAwB,aAAa,MAAM,OAAO,SAAS;AACzF,MAAM,WAAW,MAAM,aAAa,SAAA;AACpC,MAAM,OAAO,CAAC,UAAkB,aAAa,KAAK,KAAK;AACvD,MAAM,UAAU,CAAC,UAAkB,aAAa,QAAQ,KAAK;AAC7D,MAAM,kBAAkB,CAAC,WAAmB,aAAa,gBAAgB,MAAM;AAC/E,MAAM,QAAQ,CAAC,WAAmB,aAAa,MAAM,MAAM;AAC3D,MAAM,eAAe,CAAC,UAAe,aAAa,aAAa,KAAK;AACpE,MAAM,WAAW,CAAC,UAAwB,aAAa,SAAS,KAAK;AACrE,MAAM,gBAAgB,CAAC,eAA2B,aAAa,cAAc,UAAU;AACvF,MAAM,aAAa,CAAC,eAA4B,aAAa,WAAW,UAAU;AAClF,MAAM,aAAa,CAAC,SAAiB,YAAqB,YAC7D,aAAa,WAAW,SAAS,YAAY,OAAO;AACjD,MAAM,cAAc,CAAC,SAAiB,aACzC,aAAa,YAAY,SAAS,QAAQ;"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { LogLevel, Verbosity, ThemeVariant, BannerType, LoggerConfig, ILogHandler, StyleOptions } from './types/index.js';
|
|
2
|
+
import { ScopedLogger, APILogger, ComponentLogger } from './ScopedLogger.js';
|
|
3
|
+
import { ExportLogHandler } from './handlers/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Main Logger class implementing state-of-the-art logging capabilities
|
|
6
|
+
*/
|
|
7
|
+
export declare class Logger {
|
|
8
|
+
private config;
|
|
9
|
+
private scopedPrefix?;
|
|
10
|
+
private handlers;
|
|
11
|
+
private timers;
|
|
12
|
+
private groupDepth;
|
|
13
|
+
private exportHandler?;
|
|
14
|
+
private cliProcessor?;
|
|
15
|
+
private themeChangeListener?;
|
|
16
|
+
private displaySettings;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new Logger instance
|
|
19
|
+
*/
|
|
20
|
+
constructor(config?: Partial<LoggerConfig>);
|
|
21
|
+
/**
|
|
22
|
+
* Sets up automatic theme detection with change listener
|
|
23
|
+
*/
|
|
24
|
+
private setupAutoThemeDetection;
|
|
25
|
+
/**
|
|
26
|
+
* Get current configuration
|
|
27
|
+
*/
|
|
28
|
+
getConfig(): LoggerConfig;
|
|
29
|
+
/**
|
|
30
|
+
* Update configuration
|
|
31
|
+
*/
|
|
32
|
+
updateConfig(updates: Partial<LoggerConfig>): void;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the global prefix for all log messages
|
|
35
|
+
*/
|
|
36
|
+
setGlobalPrefix(prefix: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the verbosity level for filtering log output
|
|
39
|
+
*/
|
|
40
|
+
setVerbosity(level: Verbosity): void;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the logger theme
|
|
43
|
+
*/
|
|
44
|
+
setTheme(theme: ThemeVariant): void;
|
|
45
|
+
/**
|
|
46
|
+
* Set banner type for initialization display
|
|
47
|
+
*/
|
|
48
|
+
setBannerType(bannerType: BannerType): void;
|
|
49
|
+
/**
|
|
50
|
+
* Reset logger to default configuration
|
|
51
|
+
*/
|
|
52
|
+
resetConfig(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Cleanup method to remove event listeners and free resources
|
|
55
|
+
*/
|
|
56
|
+
cleanup(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Apply a smart preset - works perfectly out-of-the-box
|
|
59
|
+
*/
|
|
60
|
+
preset(name: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* List available presets
|
|
63
|
+
*/
|
|
64
|
+
presets(): string[];
|
|
65
|
+
/**
|
|
66
|
+
* Hide timestamp in logs
|
|
67
|
+
*/
|
|
68
|
+
hideTimestamp(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Show timestamp in logs
|
|
71
|
+
*/
|
|
72
|
+
showTimestamp(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Hide location info in logs
|
|
75
|
+
*/
|
|
76
|
+
hideLocation(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Show location info in logs
|
|
79
|
+
*/
|
|
80
|
+
showLocation(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Hide badges in logs
|
|
83
|
+
*/
|
|
84
|
+
hideBadges(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Show badges in logs
|
|
87
|
+
*/
|
|
88
|
+
showBadges(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Create a component logger with automatic styling
|
|
91
|
+
*/
|
|
92
|
+
component(name: string): ComponentLogger;
|
|
93
|
+
/**
|
|
94
|
+
* Create an API logger with automatic badges
|
|
95
|
+
*/
|
|
96
|
+
api(name: string): APILogger;
|
|
97
|
+
/**
|
|
98
|
+
* Create a general scoped logger with badges support
|
|
99
|
+
*/
|
|
100
|
+
scope(name: string): ScopedLogger;
|
|
101
|
+
/**
|
|
102
|
+
* Simple customization with minimal configuration
|
|
103
|
+
*/
|
|
104
|
+
customize(overrides: {
|
|
105
|
+
message?: {
|
|
106
|
+
color?: string;
|
|
107
|
+
font?: string;
|
|
108
|
+
size?: string;
|
|
109
|
+
};
|
|
110
|
+
timestamp?: {
|
|
111
|
+
show?: boolean;
|
|
112
|
+
color?: string;
|
|
113
|
+
};
|
|
114
|
+
location?: {
|
|
115
|
+
show?: boolean;
|
|
116
|
+
color?: string;
|
|
117
|
+
};
|
|
118
|
+
level?: {
|
|
119
|
+
uppercase?: boolean;
|
|
120
|
+
style?: string;
|
|
121
|
+
};
|
|
122
|
+
prefix?: {
|
|
123
|
+
show?: boolean;
|
|
124
|
+
style?: string;
|
|
125
|
+
};
|
|
126
|
+
spacing?: 'compact' | 'normal' | 'spacious';
|
|
127
|
+
}): void;
|
|
128
|
+
/**
|
|
129
|
+
* Access advanced styling API (for power users)
|
|
130
|
+
*/
|
|
131
|
+
styles(): any;
|
|
132
|
+
/**
|
|
133
|
+
* Adds a custom log handler for extensibility
|
|
134
|
+
*/
|
|
135
|
+
addHandler(handler: ILogHandler): void;
|
|
136
|
+
/**
|
|
137
|
+
* Get all registered handlers
|
|
138
|
+
*/
|
|
139
|
+
getHandlers(): ILogHandler[];
|
|
140
|
+
/**
|
|
141
|
+
* Get export handler if available
|
|
142
|
+
*/
|
|
143
|
+
getExportHandler(): ExportLogHandler | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Checks if a log level should be output based on current verbosity
|
|
146
|
+
*/
|
|
147
|
+
private shouldLog;
|
|
148
|
+
/**
|
|
149
|
+
* Gets the effective prefix (global + scoped)
|
|
150
|
+
*/
|
|
151
|
+
private getEffectivePrefix;
|
|
152
|
+
/**
|
|
153
|
+
* Core logging method that handles styling and formatting
|
|
154
|
+
*/
|
|
155
|
+
protected log(level: LogLevel, ...args: any[]): void;
|
|
156
|
+
/**
|
|
157
|
+
* Logs debug information (lowest priority)
|
|
158
|
+
*/
|
|
159
|
+
debug(...args: any[]): void;
|
|
160
|
+
/**
|
|
161
|
+
* Logs informational messages
|
|
162
|
+
*/
|
|
163
|
+
info(...args: any[]): void;
|
|
164
|
+
/**
|
|
165
|
+
* Logs warning messages
|
|
166
|
+
*/
|
|
167
|
+
warn(...args: any[]): void;
|
|
168
|
+
/**
|
|
169
|
+
* Logs error messages
|
|
170
|
+
*/
|
|
171
|
+
error(...args: any[]): void;
|
|
172
|
+
/**
|
|
173
|
+
* Logs success messages (special info level)
|
|
174
|
+
*/
|
|
175
|
+
success(...args: any[]): void;
|
|
176
|
+
/**
|
|
177
|
+
* Logs trace information (detailed debugging)
|
|
178
|
+
*/
|
|
179
|
+
trace(...args: any[]): void;
|
|
180
|
+
/**
|
|
181
|
+
* Logs critical errors (highest priority)
|
|
182
|
+
*/
|
|
183
|
+
critical(...args: any[]): void;
|
|
184
|
+
/**
|
|
185
|
+
* Displays data in a table format
|
|
186
|
+
*/
|
|
187
|
+
table(data: any, columns?: string[]): void;
|
|
188
|
+
/**
|
|
189
|
+
* Starts a collapsible group in the console
|
|
190
|
+
*/
|
|
191
|
+
group(label: string, collapsed?: boolean): void;
|
|
192
|
+
/**
|
|
193
|
+
* Ends the current console group
|
|
194
|
+
*/
|
|
195
|
+
groupEnd(): void;
|
|
196
|
+
/**
|
|
197
|
+
* Starts a timer with the given label
|
|
198
|
+
*/
|
|
199
|
+
time(label: string): void;
|
|
200
|
+
/**
|
|
201
|
+
* Ends a timer and logs the elapsed time
|
|
202
|
+
*/
|
|
203
|
+
timeEnd(label: string): void;
|
|
204
|
+
/**
|
|
205
|
+
* Display banner with specified or configured type
|
|
206
|
+
*/
|
|
207
|
+
showBanner(bannerType?: BannerType): void;
|
|
208
|
+
/**
|
|
209
|
+
* Log with SVG background image
|
|
210
|
+
*/
|
|
211
|
+
logWithSVG(message: string, svgContent?: string, options?: StyleOptions): void;
|
|
212
|
+
/**
|
|
213
|
+
* Log with animated background gradient
|
|
214
|
+
*/
|
|
215
|
+
logAnimated(message: string, duration?: number): void;
|
|
216
|
+
/**
|
|
217
|
+
* Groups logs by a specific property using modern Object.groupBy (when available)
|
|
218
|
+
*/
|
|
219
|
+
logGrouped<T>(items: T[], groupBy: (item: T) => string): void;
|
|
220
|
+
/**
|
|
221
|
+
* CLI command processor for logger configuration and export
|
|
222
|
+
*/
|
|
223
|
+
cli(command: string): Promise<void>;
|
|
224
|
+
}
|
|
225
|
+
declare const defaultLogger: Logger;
|
|
226
|
+
export default defaultLogger;
|
|
227
|
+
/**
|
|
228
|
+
* Export individual methods for convenience (with proper binding)
|
|
229
|
+
*/
|
|
230
|
+
export declare const debug: (...args: any[]) => void;
|
|
231
|
+
export declare const info: (...args: any[]) => void;
|
|
232
|
+
export declare const warn: (...args: any[]) => void;
|
|
233
|
+
export declare const error: (...args: any[]) => void;
|
|
234
|
+
export declare const success: (...args: any[]) => void;
|
|
235
|
+
export declare const trace: (...args: any[]) => void;
|
|
236
|
+
export declare const critical: (...args: any[]) => void;
|
|
237
|
+
export declare const table: (data: any, columns?: string[]) => void;
|
|
238
|
+
export declare const group: (label: string, collapsed?: boolean) => void;
|
|
239
|
+
export declare const groupEnd: () => void;
|
|
240
|
+
export declare const time: (label: string) => void;
|
|
241
|
+
export declare const timeEnd: (label: string) => void;
|
|
242
|
+
export declare const setGlobalPrefix: (prefix: string) => void;
|
|
243
|
+
export declare const setVerbosity: (level: Verbosity) => void;
|
|
244
|
+
export declare const addHandler: (handler: ILogHandler) => void;
|
|
245
|
+
export declare const setTheme: (theme: ThemeVariant) => void;
|
|
246
|
+
export declare const setBannerType: (bannerType: BannerType) => void;
|
|
247
|
+
export declare const showBanner: (bannerType?: BannerType) => void;
|
|
248
|
+
export declare const logWithSVG: (message: string, svgContent?: string, options?: StyleOptions) => void;
|
|
249
|
+
export declare const logAnimated: (message: string, duration?: number) => void;
|
|
250
|
+
export declare const cli: (command: string) => Promise<void>;
|
|
251
|
+
export declare const cleanup: () => void;
|
|
252
|
+
export declare const preset: (name: string) => void;
|
|
253
|
+
export declare const presets: () => string[];
|
|
254
|
+
export declare const hideTimestamp: () => void;
|
|
255
|
+
export declare const showTimestamp: () => void;
|
|
256
|
+
export declare const hideLocation: () => void;
|
|
257
|
+
export declare const showLocation: () => void;
|
|
258
|
+
export declare const hideBadges: () => void;
|
|
259
|
+
export declare const showBadges: () => void;
|
|
260
|
+
export declare const component: (name: string) => ComponentLogger;
|
|
261
|
+
export declare const api: (name: string) => APILogger;
|
|
262
|
+
export declare const scope: (name: string) => ScopedLogger;
|
|
263
|
+
export declare const customize: (overrides: any) => void;
|
|
264
|
+
export declare const styles: () => any;
|
|
265
|
+
export { FileLogHandler, RemoteLogHandler, AnalyticsLogHandler, ExportLogHandler } from './handlers/index.js';
|
|
266
|
+
export { StyleBuilder, StylePresets as Styles } from './styling/index.js';
|
|
267
|
+
export { ScopedLogger, APILogger, ComponentLogger } from './ScopedLogger.js';
|
|
268
|
+
//# sourceMappingURL=Logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/Logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACR,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,YAAY,EAEZ,WAAW,EAEX,YAAY,EACf,MAAM,kBAAkB,CAAC;AAqB1B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAI7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAavD;;GAEG;AACH,qBAAa,MAAM;IACf,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,aAAa,CAAC,CAAmB;IACzC,OAAO,CAAC,YAAY,CAAC,CAAmB;IACxC,OAAO,CAAC,mBAAmB,CAAC,CAAsB;IAClD,OAAO,CAAC,eAAe,CAIrB;IAEF;;OAEG;gBACS,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM;IAuB9C;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAiB/B;;OAEG;IACH,SAAS,IAAI,YAAY;IAIzB;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAelD;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIrC;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,SA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