@mks2508/better-logger 0.14.0-alpha.2 → 1.1.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 +2 -1
- package/dist/Logger.d.ts +12 -16
- package/dist/Logger.d.ts.map +1 -1
- package/dist/ScopedLogger.d.ts +1 -9
- package/dist/chunks/{Logger-D_p3xnbq.js → Logger-C9zTFYBh.js} +2 -2
- package/dist/chunks/Logger-C9zTFYBh.js.map +1 -0
- package/dist/chunks/{Logger-Crw1woqR.js → Logger-Th9SfADL.js} +50 -17
- package/dist/chunks/Logger-Th9SfADL.js.map +1 -0
- package/dist/chunks/ScopedLogger-HgV_J-ug.js +2 -0
- package/dist/chunks/ScopedLogger-HgV_J-ug.js.map +1 -0
- package/dist/chunks/ScopedLogger-uAAeJkfA.js +361 -0
- package/dist/chunks/ScopedLogger-uAAeJkfA.js.map +1 -0
- package/dist/chunks/environment-5I5unY89.js +4 -0
- package/dist/chunks/environment-5I5unY89.js.map +1 -0
- package/dist/chunks/{environment-Bxbnw4pd.js → environment-wXLQvk5g.js} +103 -11
- package/dist/chunks/environment-wXLQvk5g.js.map +1 -0
- package/dist/chunks/formatting-CiFnwe1I.js +2 -0
- package/dist/chunks/formatting-CiFnwe1I.js.map +1 -0
- package/dist/chunks/formatting-DIhpRCCk.js +380 -0
- package/dist/chunks/formatting-DIhpRCCk.js.map +1 -0
- package/dist/cli/CommandProcessor.d.ts +1 -4
- package/dist/cli/commands/ConfigCommand.d.ts +2 -5
- package/dist/cli/commands/ExportCommand.d.ts +2 -5
- package/dist/cli/commands/HistoryCommand.d.ts +2 -5
- package/dist/cli/commands/StatusCommand.d.ts +2 -5
- package/dist/cli/commands/ThemeCommand.d.ts +2 -5
- package/dist/cli/help.d.ts +2 -5
- package/dist/cli/index.d.ts +1 -1
- package/dist/constants.d.ts +110 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +1 -8
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +281 -307
- package/dist/core.js.map +1 -1
- package/dist/exports-module.d.ts +1 -8
- package/dist/exports.cjs +1 -1
- package/dist/exports.js +2 -2
- package/dist/handlers/AnalyticsLogHandler.d.ts +1 -4
- package/dist/handlers/ExportLogHandler.d.ts +1 -4
- package/dist/handlers/ExportLogHandler.d.ts.map +1 -1
- package/dist/handlers/FileLogHandler.d.ts +1 -4
- package/dist/handlers/RemoteLogHandler.d.ts +1 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +246 -159
- package/dist/index.js.map +1 -1
- package/dist/styling/LogStyleBuilder.d.ts +2 -5
- package/dist/styling/SemanticStyles.d.ts +0 -3
- package/dist/styling/SmartPresets.d.ts +1 -4
- package/dist/styling/banners.d.ts +1 -4
- package/dist/styling/themes.d.ts +2 -5
- package/dist/styling-module.d.ts +1 -8
- package/dist/styling.cjs +1 -1
- package/dist/styling.js +3 -3
- package/dist/types/core.d.ts +13 -0
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/handlers.d.ts +1 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/ansi-colors.d.ts +156 -0
- package/dist/utils/ansi-colors.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +20 -2
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/output.d.ts +1 -4
- package/dist/utils/stackTrace.d.ts +1 -4
- package/package.json +2 -1
- package/src/Logger.ts +102 -64
- package/src/constants.ts +131 -1
- package/src/core.ts +11 -7
- package/src/handlers/ExportLogHandler.ts +2 -1
- package/src/index.ts +62 -27
- package/src/styling/SemanticStyles.ts +1 -1
- package/src/types/core.ts +15 -1
- package/src/types/index.ts +1 -0
- package/src/utils/ansi-colors.ts +333 -0
- package/src/utils/formatting.ts +196 -6
- package/src/utils/index.ts +23 -11
- package/vite.config.ts +1 -1
- package/dist/.tsbuildinfo +0 -1
- package/dist/Logger.js +0 -1124
- package/dist/ScopedLogger.js +0 -426
- package/dist/chunks/Logger-Crw1woqR.js.map +0 -1
- package/dist/chunks/Logger-D_p3xnbq.js.map +0 -1
- package/dist/chunks/environment-Bxbnw4pd.js.map +0 -1
- package/dist/chunks/environment-Dm66zOML.js +0 -4
- package/dist/chunks/environment-Dm66zOML.js.map +0 -1
- package/dist/chunks/formatting-C0riPC5_.js +0 -95
- package/dist/chunks/formatting-C0riPC5_.js.map +0 -1
- package/dist/chunks/formatting-DNCAV66-.js +0 -2
- package/dist/chunks/formatting-DNCAV66-.js.map +0 -1
- package/dist/cli/CommandProcessor.js +0 -184
- package/dist/cli/commands/ConfigCommand.js +0 -88
- package/dist/cli/commands/ExportCommand.js +0 -243
- package/dist/cli/commands/HistoryCommand.js +0 -96
- package/dist/cli/commands/StatusCommand.js +0 -93
- package/dist/cli/commands/ThemeCommand.js +0 -79
- package/dist/cli/help.js +0 -118
- package/dist/cli/index.js +0 -46
- package/dist/constants.js +0 -159
- package/dist/example.js +0 -154
- package/dist/exports-module.js +0 -260
- package/dist/handlers/AnalyticsLogHandler.js +0 -19
- package/dist/handlers/ExportLogHandler.js +0 -516
- package/dist/handlers/FileLogHandler.js +0 -156
- package/dist/handlers/RemoteLogHandler.js +0 -37
- package/dist/handlers/index.js +0 -7
- package/dist/main.js +0 -139
- package/dist/styling/LogStyleBuilder.js +0 -289
- package/dist/styling/SemanticStyles.js +0 -339
- package/dist/styling/SmartPresets.js +0 -276
- package/dist/styling/StyleBuilder.js +0 -280
- package/dist/styling/banners.js +0 -155
- package/dist/styling/index.js +0 -9
- package/dist/styling/themes.js +0 -231
- package/dist/styling-module.js +0 -199
- package/dist/types/Logger.d.ts +0 -700
- package/dist/types/Logger.d.ts.map +0 -1
- package/dist/types/ScopedLogger.d.ts +0 -310
- package/dist/types/ScopedLogger.d.ts.map +0 -1
- package/dist/types/cli/CommandProcessor.d.ts +0 -100
- package/dist/types/cli/CommandProcessor.d.ts.map +0 -1
- package/dist/types/cli/commands/ConfigCommand.d.ts +0 -14
- package/dist/types/cli/commands/ConfigCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/ExportCommand.d.ts +0 -48
- package/dist/types/cli/commands/ExportCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/HistoryCommand.d.ts +0 -47
- package/dist/types/cli/commands/HistoryCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/StatusCommand.d.ts +0 -30
- package/dist/types/cli/commands/StatusCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/ThemeCommand.d.ts +0 -30
- package/dist/types/cli/commands/ThemeCommand.d.ts.map +0 -1
- package/dist/types/cli/help.d.ts +0 -12
- package/dist/types/cli/help.d.ts.map +0 -1
- package/dist/types/cli/index.d.ts +0 -15
- package/dist/types/cli/index.d.ts.map +0 -1
- package/dist/types/constants.d.ts +0 -119
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/core.js +0 -28
- package/dist/types/example.d.ts +0 -18
- package/dist/types/example.d.ts.map +0 -1
- package/dist/types/exports-module.d.ts +0 -196
- package/dist/types/exports-module.d.ts.map +0 -1
- package/dist/types/handlers/AnalyticsLogHandler.d.ts +0 -8
- package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/ExportLogHandler.d.ts +0 -100
- package/dist/types/handlers/ExportLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/FileLogHandler.d.ts +0 -33
- package/dist/types/handlers/FileLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/RemoteLogHandler.d.ts +0 -11
- package/dist/types/handlers/RemoteLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/index.d.ts +0 -8
- package/dist/types/handlers/index.d.ts.map +0 -1
- package/dist/types/handlers.js +0 -4
- package/dist/types/index.js +0 -4
- package/dist/types/main.d.ts +0 -2
- package/dist/types/main.d.ts.map +0 -1
- package/dist/types/styling/LogStyleBuilder.d.ts +0 -146
- package/dist/types/styling/LogStyleBuilder.d.ts.map +0 -1
- package/dist/types/styling/SemanticStyles.d.ts +0 -178
- package/dist/types/styling/SemanticStyles.d.ts.map +0 -1
- package/dist/types/styling/SmartPresets.d.ts +0 -22
- package/dist/types/styling/SmartPresets.d.ts.map +0 -1
- package/dist/types/styling/StyleBuilder.d.ts +0 -140
- package/dist/types/styling/StyleBuilder.d.ts.map +0 -1
- package/dist/types/styling/banners.d.ts +0 -42
- package/dist/types/styling/banners.d.ts.map +0 -1
- package/dist/types/styling/index.d.ts +0 -10
- package/dist/types/styling/index.d.ts.map +0 -1
- package/dist/types/styling/themes.d.ts +0 -7
- package/dist/types/styling/themes.d.ts.map +0 -1
- package/dist/types/styling-module.d.ts +0 -178
- package/dist/types/styling-module.d.ts.map +0 -1
- package/dist/types/types/core.d.ts +0 -221
- package/dist/types/types/core.d.ts.map +0 -1
- package/dist/types/types/handlers.d.ts +0 -85
- package/dist/types/types/handlers.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -7
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/utils/environment.d.ts +0 -47
- package/dist/types/utils/environment.d.ts.map +0 -1
- package/dist/types/utils/formatting.d.ts +0 -37
- package/dist/types/utils/formatting.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -7
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/opentui-detection.d.ts +0 -34
- package/dist/types/utils/opentui-detection.d.ts.map +0 -1
- package/dist/types/utils/output.d.ts +0 -41
- package/dist/types/utils/output.d.ts.map +0 -1
- package/dist/types/utils/stackTrace.d.ts +0 -6
- package/dist/types/utils/stackTrace.d.ts.map +0 -1
- package/dist/types/utils/timestamps.d.ts +0 -20
- package/dist/types/utils/timestamps.d.ts.map +0 -1
- package/dist/utils/environment.js +0 -85
- package/dist/utils/formatting.js +0 -117
- package/dist/utils/index.js +0 -6
- package/dist/utils/opentui-detection.js +0 -116
- package/dist/utils/output.js +0 -150
- package/dist/utils/stackTrace.js +0 -81
- package/dist/utils/timestamps.js +0 -71
package/dist/styling-module.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
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';
|