@mks2508/better-logger 5.0.0 → 5.0.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/dist/chunks/{Logger-Cbi1f10o.js → Logger-CKqzXDh3.js} +2 -2
- package/dist/chunks/{Logger-Cbi1f10o.js.map → Logger-CKqzXDh3.js.map} +1 -1
- package/dist/chunks/{Logger-BZ7B7OXE.js → Logger-D_vuKP4l.js} +2 -2
- package/dist/chunks/{Logger-BZ7B7OXE.js.map → Logger-D_vuKP4l.js.map} +1 -1
- package/dist/chunks/cli-module-B-njrTWb.js +2 -0
- package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
- package/dist/chunks/{cli-module-ClIJmaT8.js → cli-module-Cx7qotPY.js} +16 -9
- package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/exports.cjs +1 -1
- package/dist/exports.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/styling.cjs +1 -1
- package/dist/styling.js +2 -2
- package/dist/terminal/formatter.d.ts.map +1 -1
- package/package.json +5 -1
- package/.claude/settings.local.json +0 -48
- package/.github/workflows/ci-quality.yml +0 -357
- package/.github/workflows/docs-demo.yml +0 -119
- package/.github/workflows/releases-core.yml +0 -512
- package/.github/workflows/releases-full.yml +0 -582
- package/.github/workflows-backup/ci.yml +0 -221
- package/.github/workflows-backup/nightly.yml +0 -196
- package/.github/workflows-backup/release-optimized.yml +0 -373
- package/.github/workflows-backup/release.yml +0 -269
- package/.release-notes-0.2.0.md +0 -129
- package/.yamllint +0 -28
- package/CHANGELOG.json +0 -1076
- package/CHANGELOG.md +0 -209
- package/CLAUDE.md +0 -217
- package/bun.lock +0 -333
- package/demo.html +0 -847
- package/dist/chunks/cli-module-CadqgZ1Z.js +0 -2
- package/dist/chunks/cli-module-CadqgZ1Z.js.map +0 -1
- package/dist/chunks/cli-module-ClIJmaT8.js.map +0 -1
- package/docs/API.md +0 -918
- package/docs/CORE.md +0 -264
- package/docs/DEVELOPMENT.md +0 -731
- package/docs/EXPORTS.md +0 -467
- package/docs/PACKAGES.md +0 -244
- package/docs/STYLING.md +0 -405
- package/docs/_config.yml +0 -36
- package/docs/index.md +0 -179
- package/examples/README.md +0 -208
- package/examples/basic-logging.js +0 -75
- package/examples/data-export.js +0 -234
- package/examples/package.json +0 -16
- package/examples/performance-timing.js +0 -170
- package/examples/simplified-api.js +0 -124
- package/examples/styling-themes.js +0 -207
- package/index.html +0 -358
- package/packages/core/package.json +0 -57
- package/packages/exports/package.json +0 -41
- package/packages/nodejs-opentui/README.md +0 -232
- package/packages/nodejs-opentui/package.json +0 -72
- package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
- package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
- package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
- package/packages/nodejs-opentui/src/index.ts +0 -133
- package/packages/nodejs-opentui/src/types.ts +0 -158
- package/packages/nodejs-opentui/tsconfig.json +0 -20
- package/packages/styling/package.json +0 -41
- package/playground/demo-all.ts +0 -95
- package/playground/demo-box.ts +0 -85
- package/playground/demo-levels.ts +0 -56
- package/playground/demo-real-world.ts +0 -98
- package/playground/demo-spinner.ts +0 -77
- package/playground/demo-steps.ts +0 -72
- package/playground/demo-table.ts +0 -83
- package/project-utils/README.md +0 -172
- package/project-utils/auto-release-gemini.ts +0 -1193
- package/project-utils/auto-release-ui.ts +0 -1329
- package/project-utils/commit-generator.ts +0 -1385
- package/project-utils/commit-ui.ts +0 -264
- package/project-utils/git-utils.ts +0 -199
- package/project-utils/github-release-manager.ts +0 -466
- package/project-utils/project-config.ts +0 -260
- package/project-utils/prompt-templates.js +0 -345
- package/project-utils/prompt-templates.ts +0 -422
- package/project-utils/version-manager.ts +0 -1078
- package/public/vite.svg +0 -1
- package/src/Logger.ts +0 -1858
- package/src/ScopedLogger.ts +0 -256
- package/src/cli/CommandProcessor.ts +0 -248
- package/src/cli/commands/ConfigCommand.ts +0 -93
- package/src/cli/commands/ExportCommand.ts +0 -276
- package/src/cli/commands/HistoryCommand.ts +0 -117
- package/src/cli/commands/StatusCommand.ts +0 -112
- package/src/cli/commands/ThemeCommand.ts +0 -88
- package/src/cli/help.ts +0 -127
- package/src/cli/index.ts +0 -71
- package/src/cli-module.ts +0 -21
- package/src/cli-primitives/box.ts +0 -86
- package/src/cli-primitives/cli-table.ts +0 -62
- package/src/cli-primitives/divider.ts +0 -17
- package/src/cli-primitives/header.ts +0 -18
- package/src/cli-primitives/index.ts +0 -13
- package/src/cli-primitives/server-fallback.ts +0 -54
- package/src/cli-primitives/spinner.ts +0 -133
- package/src/cli-primitives/step.ts +0 -22
- package/src/constants.ts +0 -313
- package/src/core.ts +0 -397
- package/src/example.ts +0 -210
- package/src/exports-module.ts +0 -311
- package/src/handlers/AnalyticsLogHandler.ts +0 -22
- package/src/handlers/ExportLogHandler.ts +0 -610
- package/src/handlers/FileLogHandler.ts +0 -169
- package/src/handlers/RemoteLogHandler.ts +0 -42
- package/src/handlers/index.ts +0 -8
- package/src/hooks/HookManager.ts +0 -177
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -395
- package/src/main.ts +0 -196
- package/src/serializers/SerializerRegistry.ts +0 -173
- package/src/serializers/index.ts +0 -1
- package/src/style.css +0 -96
- package/src/styling/LogStyleBuilder.ts +0 -355
- package/src/styling/SemanticStyles.ts +0 -380
- package/src/styling/SmartPresets.ts +0 -288
- package/src/styling/StyleBuilder.ts +0 -319
- package/src/styling/StyleCache.ts +0 -131
- package/src/styling/banners.ts +0 -168
- package/src/styling/index.ts +0 -27
- package/src/styling/themes.ts +0 -235
- package/src/styling-module.ts +0 -244
- package/src/terminal/color-converter.ts +0 -315
- package/src/terminal/formatter.ts +0 -236
- package/src/terminal/terminal-renderer.ts +0 -342
- package/src/transports/ConsoleTransport.ts +0 -28
- package/src/transports/FileTransport.ts +0 -53
- package/src/transports/HttpTransport.ts +0 -56
- package/src/transports/TransportManager.ts +0 -130
- package/src/transports/index.ts +0 -4
- package/src/types/core.ts +0 -417
- package/src/types/handlers.ts +0 -95
- package/src/types/hooks.ts +0 -45
- package/src/types/index.ts +0 -83
- package/src/types/serializers.ts +0 -30
- package/src/types/transports.ts +0 -52
- package/src/typescript.svg +0 -1
- package/src/utils/adapter.ts +0 -291
- package/src/utils/ansi-colors.ts +0 -333
- package/src/utils/environment-detector.ts +0 -170
- package/src/utils/environment.ts +0 -94
- package/src/utils/formatting.ts +0 -332
- package/src/utils/index.ts +0 -33
- package/src/utils/opentui-detection.ts +0 -138
- package/src/utils/output.ts +0 -227
- package/src/utils/stackTrace.ts +0 -144
- package/src/utils/timestamps.ts +0 -80
- package/src/vite-env.d.ts +0 -1
- package/src/writers/BufferWriter.ts +0 -157
- package/src/writers/index.ts +0 -6
- package/test-core-browser.html +0 -237
- package/test-core-node.js +0 -63
- package/tests/test-conflict-resolution.ts +0 -391
- package/tests/validate-workflows.sh +0 -131
- package/tests/yaml-autofix.sh +0 -146
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -256
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Semantic styling system for Advanced Logger
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { StyleBuilder } from './StyleBuilder.js';
|
|
6
|
-
import type { AdaptiveColors } from '../types/index.js';
|
|
7
|
-
import { ADAPTIVE_COLORS } from '../constants.js';
|
|
8
|
-
import { getAdaptiveColor } from '../utils/output.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Base semantic styler with common style methods
|
|
12
|
-
*/
|
|
13
|
-
export abstract class BaseStyler {
|
|
14
|
-
protected builder: StyleBuilder;
|
|
15
|
-
|
|
16
|
-
constructor(builder: StyleBuilder = new StyleBuilder()) {
|
|
17
|
-
this.builder = builder;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Primary brand color (typically blue)
|
|
22
|
-
*/
|
|
23
|
-
primary(): this {
|
|
24
|
-
return this.color('#007bff');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Secondary color (typically gray)
|
|
29
|
-
*/
|
|
30
|
-
secondary(): this {
|
|
31
|
-
return this.color('#6c757d');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Accent color for highlights
|
|
36
|
-
*/
|
|
37
|
-
accent(): this {
|
|
38
|
-
return this.color('#17a2b8');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Muted/subtle color - automatically adaptive
|
|
43
|
-
*/
|
|
44
|
-
muted(): this {
|
|
45
|
-
const mutedColors: AdaptiveColors = { light: '#6c757d', dark: '#a0aec0' };
|
|
46
|
-
return this.color(getAdaptiveColor(mutedColors));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Success color (green)
|
|
51
|
-
*/
|
|
52
|
-
success(): this {
|
|
53
|
-
return this.color('#28a745');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Warning color (yellow/orange)
|
|
58
|
-
*/
|
|
59
|
-
warning(): this {
|
|
60
|
-
return this.color('#ffc107');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Danger/error color (red)
|
|
65
|
-
*/
|
|
66
|
-
danger(): this {
|
|
67
|
-
return this.color('#dc3545');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Monospace font family
|
|
72
|
-
*/
|
|
73
|
-
mono(): this {
|
|
74
|
-
this.builder.font('Monaco, Consolas, "Courier New", monospace');
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* System font family
|
|
80
|
-
*/
|
|
81
|
-
system(): this {
|
|
82
|
-
this.builder.font('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif');
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Readable font optimized for text
|
|
88
|
-
*/
|
|
89
|
-
readable(): this {
|
|
90
|
-
this.builder.font('Georgia, "Times New Roman", serif');
|
|
91
|
-
return this;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Compact spacing
|
|
96
|
-
*/
|
|
97
|
-
compact(): this {
|
|
98
|
-
this.builder.padding('1px 4px').margin('0 1px');
|
|
99
|
-
return this;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Spacious layout
|
|
104
|
-
*/
|
|
105
|
-
spacious(): this {
|
|
106
|
-
this.builder.padding('6px 12px').margin('2px 4px');
|
|
107
|
-
return this;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Inline display
|
|
112
|
-
*/
|
|
113
|
-
inline(): this {
|
|
114
|
-
this.builder.display('inline-block');
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Glass morphism effect
|
|
120
|
-
*/
|
|
121
|
-
glassmorphic(): this {
|
|
122
|
-
this.builder
|
|
123
|
-
.css('backdrop-filter', 'blur(10px)')
|
|
124
|
-
.css('background', 'rgba(255, 255, 255, 0.1)')
|
|
125
|
-
.border('1px solid rgba(255, 255, 255, 0.2)')
|
|
126
|
-
.rounded('8px');
|
|
127
|
-
return this;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Neon glow effect
|
|
132
|
-
*/
|
|
133
|
-
neon(): this {
|
|
134
|
-
const neonColor = '#00ffff';
|
|
135
|
-
this.builder
|
|
136
|
-
.color(neonColor)
|
|
137
|
-
.border(`1px solid ${neonColor}`)
|
|
138
|
-
.shadow(`0 0 10px ${neonColor}, 0 0 20px ${neonColor}`)
|
|
139
|
-
.css('text-shadow', `0 0 5px ${neonColor}`);
|
|
140
|
-
return this;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Gradient background
|
|
145
|
-
*/
|
|
146
|
-
gradient(from: string = '#667eea', to: string = '#764ba2'): this {
|
|
147
|
-
this.builder.bg(`linear-gradient(135deg, ${from} 0%, ${to} 100%)`);
|
|
148
|
-
return this;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Bold text
|
|
153
|
-
*/
|
|
154
|
-
bold(): this {
|
|
155
|
-
this.builder.bold();
|
|
156
|
-
return this;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Set color with automatic adaptation
|
|
161
|
-
*/
|
|
162
|
-
protected color(color: string): this {
|
|
163
|
-
this.builder.color(color);
|
|
164
|
-
return this;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Build the final CSS string
|
|
169
|
-
*/
|
|
170
|
-
build(): string {
|
|
171
|
-
return this.builder.build();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Timestamp-specific styling
|
|
177
|
-
*/
|
|
178
|
-
export class TimestampStyler extends BaseStyler {
|
|
179
|
-
/**
|
|
180
|
-
* Default timestamp style - subtle and informative
|
|
181
|
-
*/
|
|
182
|
-
default(): this {
|
|
183
|
-
this.muted().mono();
|
|
184
|
-
this.builder.size('11px');
|
|
185
|
-
return this;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Hide timestamp
|
|
190
|
-
*/
|
|
191
|
-
hidden(): this {
|
|
192
|
-
this.builder.display('none');
|
|
193
|
-
return this;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Minimal timestamp (just time, no date)
|
|
198
|
-
*/
|
|
199
|
-
minimal(): this {
|
|
200
|
-
this.muted().mono();
|
|
201
|
-
this.builder.size('10px').opacity(0.7);
|
|
202
|
-
return this;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Set font size
|
|
207
|
-
*/
|
|
208
|
-
size(size: string): this {
|
|
209
|
-
this.builder.size(size);
|
|
210
|
-
return this;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Level badge styling
|
|
216
|
-
*/
|
|
217
|
-
export class LevelStyler extends BaseStyler {
|
|
218
|
-
/**
|
|
219
|
-
* Colorful gradient badge
|
|
220
|
-
*/
|
|
221
|
-
badge(): this {
|
|
222
|
-
this.builder
|
|
223
|
-
.padding('2px 8px')
|
|
224
|
-
.rounded('4px')
|
|
225
|
-
.bold()
|
|
226
|
-
.color('#ffffff');
|
|
227
|
-
return this;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Glowing effect for dark themes
|
|
232
|
-
*/
|
|
233
|
-
glowing(): this {
|
|
234
|
-
return this.neon().badge();
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Minimal flat style
|
|
239
|
-
*/
|
|
240
|
-
flat(): this {
|
|
241
|
-
this.builder
|
|
242
|
-
.padding('1px 6px')
|
|
243
|
-
.rounded('2px')
|
|
244
|
-
.border('1px solid currentColor')
|
|
245
|
-
.css('background', 'transparent');
|
|
246
|
-
return this;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Uppercase text
|
|
251
|
-
*/
|
|
252
|
-
uppercase(): this {
|
|
253
|
-
this.builder.uppercase();
|
|
254
|
-
return this;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Prefix styling
|
|
260
|
-
*/
|
|
261
|
-
export class PrefixStyler extends BaseStyler {
|
|
262
|
-
/**
|
|
263
|
-
* Dark theme prefix
|
|
264
|
-
*/
|
|
265
|
-
dark(): this {
|
|
266
|
-
const prefixColors: AdaptiveColors = { light: '#2d3748', dark: '#4a5568' };
|
|
267
|
-
const textColors: AdaptiveColors = { light: '#e2e8f0', dark: '#f7fafc' };
|
|
268
|
-
|
|
269
|
-
this.builder
|
|
270
|
-
.bg(getAdaptiveColor(prefixColors))
|
|
271
|
-
.color(getAdaptiveColor(textColors))
|
|
272
|
-
.padding('2px 6px')
|
|
273
|
-
.rounded('3px')
|
|
274
|
-
.bold()
|
|
275
|
-
.mono()
|
|
276
|
-
.size('11px');
|
|
277
|
-
return this;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Light theme prefix
|
|
282
|
-
*/
|
|
283
|
-
light(): this {
|
|
284
|
-
this.builder
|
|
285
|
-
.bg('#f8f9fa')
|
|
286
|
-
.color('#495057')
|
|
287
|
-
.padding('2px 6px')
|
|
288
|
-
.rounded('3px')
|
|
289
|
-
.bold()
|
|
290
|
-
.mono()
|
|
291
|
-
.size('11px')
|
|
292
|
-
.border('1px solid #dee2e6');
|
|
293
|
-
return this;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Compact prefix
|
|
298
|
-
*/
|
|
299
|
-
compact(): this {
|
|
300
|
-
this.builder
|
|
301
|
-
.padding('1px 4px')
|
|
302
|
-
.size('10px')
|
|
303
|
-
.rounded('2px');
|
|
304
|
-
return this;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Message text styling
|
|
310
|
-
*/
|
|
311
|
-
export class MessageStyler extends BaseStyler {
|
|
312
|
-
/**
|
|
313
|
-
* Readable message text - automatically adaptive
|
|
314
|
-
*/
|
|
315
|
-
readable(): this {
|
|
316
|
-
this.builder
|
|
317
|
-
.color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))
|
|
318
|
-
.system()
|
|
319
|
-
.size('14px');
|
|
320
|
-
return this;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Code-style monospace text
|
|
325
|
-
*/
|
|
326
|
-
code(): this {
|
|
327
|
-
this.builder
|
|
328
|
-
.mono()
|
|
329
|
-
.size('13px')
|
|
330
|
-
.color(getAdaptiveColor(ADAPTIVE_COLORS.messageText))
|
|
331
|
-
.bg('rgba(0, 0, 0, 0.05)')
|
|
332
|
-
.padding('1px 4px')
|
|
333
|
-
.rounded('3px');
|
|
334
|
-
return this;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Large, prominent text
|
|
339
|
-
*/
|
|
340
|
-
large(): this {
|
|
341
|
-
this.builder
|
|
342
|
-
.size('16px')
|
|
343
|
-
.color(getAdaptiveColor(ADAPTIVE_COLORS.messageText));
|
|
344
|
-
return this;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Location info styling
|
|
350
|
-
*/
|
|
351
|
-
export class LocationStyler extends BaseStyler {
|
|
352
|
-
/**
|
|
353
|
-
* Subtle location info - automatically adaptive
|
|
354
|
-
*/
|
|
355
|
-
subtle(): this {
|
|
356
|
-
this.builder
|
|
357
|
-
.color(getAdaptiveColor(ADAPTIVE_COLORS.location))
|
|
358
|
-
.mono()
|
|
359
|
-
.size('11px')
|
|
360
|
-
.opacity(0.7);
|
|
361
|
-
return this;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Hide location info
|
|
366
|
-
*/
|
|
367
|
-
hidden(): this {
|
|
368
|
-
this.builder.display('none');
|
|
369
|
-
return this;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Clickable style (for IDE integration)
|
|
374
|
-
*/
|
|
375
|
-
clickable(): this {
|
|
376
|
-
this.subtle();
|
|
377
|
-
this.builder.css('text-decoration', 'underline').cursor('pointer');
|
|
378
|
-
return this;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Smart presets for simplified logger configuration
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { LogStyles, LogLayout } from '../types/index.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Smart presets that configure the entire log appearance
|
|
9
|
-
*/
|
|
10
|
-
export const SMART_PRESETS: Record<string, LogStyles> = {
|
|
11
|
-
/**
|
|
12
|
-
* Default preset - works perfectly out-of-the-box
|
|
13
|
-
* Clean, readable, automatically adaptive to dark/light themes
|
|
14
|
-
*/
|
|
15
|
-
default: {
|
|
16
|
-
layout: {
|
|
17
|
-
spacing: 'normal',
|
|
18
|
-
innerPadding: '2px',
|
|
19
|
-
outerMargin: '1px'
|
|
20
|
-
},
|
|
21
|
-
timestamp: {
|
|
22
|
-
show: true,
|
|
23
|
-
color: 'auto', // Automatically adaptive
|
|
24
|
-
font: 'Monaco, Consolas, monospace',
|
|
25
|
-
size: '11px'
|
|
26
|
-
},
|
|
27
|
-
level: {
|
|
28
|
-
show: true,
|
|
29
|
-
style: 'badge',
|
|
30
|
-
uppercase: false,
|
|
31
|
-
padding: '2px 8px'
|
|
32
|
-
},
|
|
33
|
-
prefix: {
|
|
34
|
-
show: true,
|
|
35
|
-
style: 'dark', // Automatically adaptive
|
|
36
|
-
padding: '2px 6px'
|
|
37
|
-
},
|
|
38
|
-
message: {
|
|
39
|
-
show: true,
|
|
40
|
-
color: 'auto', // Automatically adaptive
|
|
41
|
-
font: 'system-ui, -apple-system, sans-serif',
|
|
42
|
-
size: '14px'
|
|
43
|
-
},
|
|
44
|
-
location: {
|
|
45
|
-
show: true,
|
|
46
|
-
color: 'auto', // Automatically adaptive
|
|
47
|
-
font: 'Monaco, Consolas, monospace',
|
|
48
|
-
size: '11px'
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Cyberpunk preset - neon colors, glowing effects, dark theme
|
|
54
|
-
*/
|
|
55
|
-
cyberpunk: {
|
|
56
|
-
layout: {
|
|
57
|
-
spacing: 'compact',
|
|
58
|
-
innerPadding: '1px',
|
|
59
|
-
outerMargin: '0px'
|
|
60
|
-
},
|
|
61
|
-
timestamp: {
|
|
62
|
-
show: true,
|
|
63
|
-
color: '#00ffff',
|
|
64
|
-
font: 'Monaco, Consolas, monospace',
|
|
65
|
-
size: '10px',
|
|
66
|
-
style: 'neon'
|
|
67
|
-
},
|
|
68
|
-
level: {
|
|
69
|
-
show: true,
|
|
70
|
-
style: 'glowing',
|
|
71
|
-
uppercase: true,
|
|
72
|
-
padding: '2px 8px'
|
|
73
|
-
},
|
|
74
|
-
prefix: {
|
|
75
|
-
show: true,
|
|
76
|
-
color: '#ff0080',
|
|
77
|
-
background: 'rgba(255, 0, 128, 0.1)',
|
|
78
|
-
border: '1px solid #ff0080',
|
|
79
|
-
style: 'neon'
|
|
80
|
-
},
|
|
81
|
-
message: {
|
|
82
|
-
show: true,
|
|
83
|
-
color: '#00ff41',
|
|
84
|
-
font: 'Monaco, Consolas, monospace',
|
|
85
|
-
size: '13px'
|
|
86
|
-
},
|
|
87
|
-
location: {
|
|
88
|
-
show: false // Hidden for cleaner look
|
|
89
|
-
},
|
|
90
|
-
backdrop: 'blur(2px)',
|
|
91
|
-
transparency: 0.9
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Glassmorphism preset - modern blur effects, transparency
|
|
96
|
-
*/
|
|
97
|
-
glassmorphism: {
|
|
98
|
-
layout: {
|
|
99
|
-
spacing: 'spacious',
|
|
100
|
-
innerPadding: '4px',
|
|
101
|
-
outerMargin: '2px'
|
|
102
|
-
},
|
|
103
|
-
timestamp: {
|
|
104
|
-
show: true,
|
|
105
|
-
color: 'auto',
|
|
106
|
-
font: 'system-ui, sans-serif',
|
|
107
|
-
size: '11px',
|
|
108
|
-
style: 'glassmorphic'
|
|
109
|
-
},
|
|
110
|
-
level: {
|
|
111
|
-
show: true,
|
|
112
|
-
style: 'glassmorphic',
|
|
113
|
-
uppercase: false,
|
|
114
|
-
padding: '4px 12px'
|
|
115
|
-
},
|
|
116
|
-
prefix: {
|
|
117
|
-
show: true,
|
|
118
|
-
style: 'glassmorphic',
|
|
119
|
-
padding: '3px 8px'
|
|
120
|
-
},
|
|
121
|
-
message: {
|
|
122
|
-
show: true,
|
|
123
|
-
color: 'auto',
|
|
124
|
-
font: 'system-ui, sans-serif',
|
|
125
|
-
size: '14px'
|
|
126
|
-
},
|
|
127
|
-
location: {
|
|
128
|
-
show: true,
|
|
129
|
-
color: 'auto',
|
|
130
|
-
font: 'system-ui, sans-serif',
|
|
131
|
-
size: '11px',
|
|
132
|
-
style: 'glassmorphic'
|
|
133
|
-
},
|
|
134
|
-
backdrop: 'blur(10px)',
|
|
135
|
-
transparency: 0.8
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Minimal preset - clean, no decorations, maximum readability
|
|
140
|
-
*/
|
|
141
|
-
minimal: {
|
|
142
|
-
layout: {
|
|
143
|
-
spacing: 'compact',
|
|
144
|
-
innerPadding: '0px',
|
|
145
|
-
outerMargin: '0px'
|
|
146
|
-
},
|
|
147
|
-
timestamp: {
|
|
148
|
-
show: false // Hidden for minimal look
|
|
149
|
-
},
|
|
150
|
-
level: {
|
|
151
|
-
show: true,
|
|
152
|
-
style: 'flat',
|
|
153
|
-
uppercase: true,
|
|
154
|
-
padding: '0px 4px',
|
|
155
|
-
border: 'none',
|
|
156
|
-
background: 'transparent'
|
|
157
|
-
},
|
|
158
|
-
prefix: {
|
|
159
|
-
show: true,
|
|
160
|
-
style: 'flat',
|
|
161
|
-
padding: '0px 4px',
|
|
162
|
-
border: 'none',
|
|
163
|
-
background: 'transparent'
|
|
164
|
-
},
|
|
165
|
-
message: {
|
|
166
|
-
show: true,
|
|
167
|
-
color: 'auto',
|
|
168
|
-
font: 'system-ui, sans-serif',
|
|
169
|
-
size: '14px'
|
|
170
|
-
},
|
|
171
|
-
location: {
|
|
172
|
-
show: false // Hidden for minimal look
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Debug preset - monospace, detailed, compact for development
|
|
178
|
-
*/
|
|
179
|
-
debug: {
|
|
180
|
-
layout: {
|
|
181
|
-
spacing: 'compact',
|
|
182
|
-
innerPadding: '1px',
|
|
183
|
-
outerMargin: '0px'
|
|
184
|
-
},
|
|
185
|
-
timestamp: {
|
|
186
|
-
show: true,
|
|
187
|
-
color: 'auto',
|
|
188
|
-
font: 'Monaco, Consolas, monospace',
|
|
189
|
-
size: '10px'
|
|
190
|
-
},
|
|
191
|
-
level: {
|
|
192
|
-
show: true,
|
|
193
|
-
style: 'compact',
|
|
194
|
-
uppercase: true,
|
|
195
|
-
padding: '1px 4px',
|
|
196
|
-
font: 'Monaco, Consolas, monospace',
|
|
197
|
-
size: '10px'
|
|
198
|
-
},
|
|
199
|
-
prefix: {
|
|
200
|
-
show: true,
|
|
201
|
-
style: 'compact',
|
|
202
|
-
padding: '1px 4px',
|
|
203
|
-
font: 'Monaco, Consolas, monospace',
|
|
204
|
-
size: '10px'
|
|
205
|
-
},
|
|
206
|
-
message: {
|
|
207
|
-
show: true,
|
|
208
|
-
color: 'auto',
|
|
209
|
-
font: 'Monaco, Consolas, monospace',
|
|
210
|
-
size: '12px'
|
|
211
|
-
},
|
|
212
|
-
location: {
|
|
213
|
-
show: true,
|
|
214
|
-
color: 'auto',
|
|
215
|
-
font: 'Monaco, Consolas, monospace',
|
|
216
|
-
size: '10px',
|
|
217
|
-
style: 'clickable'
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Production preset - clean, essential info only
|
|
223
|
-
*/
|
|
224
|
-
production: {
|
|
225
|
-
layout: {
|
|
226
|
-
spacing: 'normal',
|
|
227
|
-
innerPadding: '2px',
|
|
228
|
-
outerMargin: '1px'
|
|
229
|
-
},
|
|
230
|
-
timestamp: {
|
|
231
|
-
show: true,
|
|
232
|
-
color: 'auto',
|
|
233
|
-
font: 'system-ui, sans-serif',
|
|
234
|
-
size: '11px'
|
|
235
|
-
},
|
|
236
|
-
level: {
|
|
237
|
-
show: true,
|
|
238
|
-
style: 'badge',
|
|
239
|
-
uppercase: false,
|
|
240
|
-
padding: '2px 6px'
|
|
241
|
-
},
|
|
242
|
-
prefix: {
|
|
243
|
-
show: false // Hidden in production
|
|
244
|
-
},
|
|
245
|
-
message: {
|
|
246
|
-
show: true,
|
|
247
|
-
color: 'auto',
|
|
248
|
-
font: 'system-ui, sans-serif',
|
|
249
|
-
size: '14px'
|
|
250
|
-
},
|
|
251
|
-
location: {
|
|
252
|
-
show: false // Hidden in production
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Get a smart preset by name
|
|
259
|
-
*/
|
|
260
|
-
export function getSmartPreset(name: string): LogStyles | null {
|
|
261
|
-
return SMART_PRESETS[name] || null;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* List all available smart presets
|
|
266
|
-
*/
|
|
267
|
-
export function getAvailablePresets(): string[] {
|
|
268
|
-
return Object.keys(SMART_PRESETS);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Check if a preset exists
|
|
273
|
-
*/
|
|
274
|
-
export function hasPreset(name: string): boolean {
|
|
275
|
-
return name in SMART_PRESETS;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Preset descriptions for help/documentation
|
|
280
|
-
*/
|
|
281
|
-
export const PRESET_DESCRIPTIONS: Record<string, string> = {
|
|
282
|
-
default: 'Clean, readable, automatically adaptive to dark/light themes',
|
|
283
|
-
cyberpunk: 'Neon colors, glowing effects, perfect for dark themes',
|
|
284
|
-
glassmorphism: 'Modern blur effects with transparency and spacious layout',
|
|
285
|
-
minimal: 'Clean and simple, no decorations, maximum readability',
|
|
286
|
-
debug: 'Monospace fonts, detailed info, compact layout for development',
|
|
287
|
-
production: 'Professional look with essential information only'
|
|
288
|
-
};
|