@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.
Files changed (162) hide show
  1. package/dist/chunks/{Logger-Cbi1f10o.js → Logger-CKqzXDh3.js} +2 -2
  2. package/dist/chunks/{Logger-Cbi1f10o.js.map → Logger-CKqzXDh3.js.map} +1 -1
  3. package/dist/chunks/{Logger-BZ7B7OXE.js → Logger-D_vuKP4l.js} +2 -2
  4. package/dist/chunks/{Logger-BZ7B7OXE.js.map → Logger-D_vuKP4l.js.map} +1 -1
  5. package/dist/chunks/cli-module-B-njrTWb.js +2 -0
  6. package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
  7. package/dist/chunks/{cli-module-ClIJmaT8.js → cli-module-Cx7qotPY.js} +16 -9
  8. package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
  9. package/dist/cli.cjs +1 -1
  10. package/dist/cli.js +1 -1
  11. package/dist/exports.cjs +1 -1
  12. package/dist/exports.js +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +3 -3
  15. package/dist/styling.cjs +1 -1
  16. package/dist/styling.js +2 -2
  17. package/dist/terminal/formatter.d.ts.map +1 -1
  18. package/package.json +5 -1
  19. package/.claude/settings.local.json +0 -48
  20. package/.github/workflows/ci-quality.yml +0 -357
  21. package/.github/workflows/docs-demo.yml +0 -119
  22. package/.github/workflows/releases-core.yml +0 -512
  23. package/.github/workflows/releases-full.yml +0 -582
  24. package/.github/workflows-backup/ci.yml +0 -221
  25. package/.github/workflows-backup/nightly.yml +0 -196
  26. package/.github/workflows-backup/release-optimized.yml +0 -373
  27. package/.github/workflows-backup/release.yml +0 -269
  28. package/.release-notes-0.2.0.md +0 -129
  29. package/.yamllint +0 -28
  30. package/CHANGELOG.json +0 -1076
  31. package/CHANGELOG.md +0 -209
  32. package/CLAUDE.md +0 -217
  33. package/bun.lock +0 -333
  34. package/demo.html +0 -847
  35. package/dist/chunks/cli-module-CadqgZ1Z.js +0 -2
  36. package/dist/chunks/cli-module-CadqgZ1Z.js.map +0 -1
  37. package/dist/chunks/cli-module-ClIJmaT8.js.map +0 -1
  38. package/docs/API.md +0 -918
  39. package/docs/CORE.md +0 -264
  40. package/docs/DEVELOPMENT.md +0 -731
  41. package/docs/EXPORTS.md +0 -467
  42. package/docs/PACKAGES.md +0 -244
  43. package/docs/STYLING.md +0 -405
  44. package/docs/_config.yml +0 -36
  45. package/docs/index.md +0 -179
  46. package/examples/README.md +0 -208
  47. package/examples/basic-logging.js +0 -75
  48. package/examples/data-export.js +0 -234
  49. package/examples/package.json +0 -16
  50. package/examples/performance-timing.js +0 -170
  51. package/examples/simplified-api.js +0 -124
  52. package/examples/styling-themes.js +0 -207
  53. package/index.html +0 -358
  54. package/packages/core/package.json +0 -57
  55. package/packages/exports/package.json +0 -41
  56. package/packages/nodejs-opentui/README.md +0 -232
  57. package/packages/nodejs-opentui/package.json +0 -72
  58. package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
  59. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
  60. package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
  61. package/packages/nodejs-opentui/src/index.ts +0 -133
  62. package/packages/nodejs-opentui/src/types.ts +0 -158
  63. package/packages/nodejs-opentui/tsconfig.json +0 -20
  64. package/packages/styling/package.json +0 -41
  65. package/playground/demo-all.ts +0 -95
  66. package/playground/demo-box.ts +0 -85
  67. package/playground/demo-levels.ts +0 -56
  68. package/playground/demo-real-world.ts +0 -98
  69. package/playground/demo-spinner.ts +0 -77
  70. package/playground/demo-steps.ts +0 -72
  71. package/playground/demo-table.ts +0 -83
  72. package/project-utils/README.md +0 -172
  73. package/project-utils/auto-release-gemini.ts +0 -1193
  74. package/project-utils/auto-release-ui.ts +0 -1329
  75. package/project-utils/commit-generator.ts +0 -1385
  76. package/project-utils/commit-ui.ts +0 -264
  77. package/project-utils/git-utils.ts +0 -199
  78. package/project-utils/github-release-manager.ts +0 -466
  79. package/project-utils/project-config.ts +0 -260
  80. package/project-utils/prompt-templates.js +0 -345
  81. package/project-utils/prompt-templates.ts +0 -422
  82. package/project-utils/version-manager.ts +0 -1078
  83. package/public/vite.svg +0 -1
  84. package/src/Logger.ts +0 -1858
  85. package/src/ScopedLogger.ts +0 -256
  86. package/src/cli/CommandProcessor.ts +0 -248
  87. package/src/cli/commands/ConfigCommand.ts +0 -93
  88. package/src/cli/commands/ExportCommand.ts +0 -276
  89. package/src/cli/commands/HistoryCommand.ts +0 -117
  90. package/src/cli/commands/StatusCommand.ts +0 -112
  91. package/src/cli/commands/ThemeCommand.ts +0 -88
  92. package/src/cli/help.ts +0 -127
  93. package/src/cli/index.ts +0 -71
  94. package/src/cli-module.ts +0 -21
  95. package/src/cli-primitives/box.ts +0 -86
  96. package/src/cli-primitives/cli-table.ts +0 -62
  97. package/src/cli-primitives/divider.ts +0 -17
  98. package/src/cli-primitives/header.ts +0 -18
  99. package/src/cli-primitives/index.ts +0 -13
  100. package/src/cli-primitives/server-fallback.ts +0 -54
  101. package/src/cli-primitives/spinner.ts +0 -133
  102. package/src/cli-primitives/step.ts +0 -22
  103. package/src/constants.ts +0 -313
  104. package/src/core.ts +0 -397
  105. package/src/example.ts +0 -210
  106. package/src/exports-module.ts +0 -311
  107. package/src/handlers/AnalyticsLogHandler.ts +0 -22
  108. package/src/handlers/ExportLogHandler.ts +0 -610
  109. package/src/handlers/FileLogHandler.ts +0 -169
  110. package/src/handlers/RemoteLogHandler.ts +0 -42
  111. package/src/handlers/index.ts +0 -8
  112. package/src/hooks/HookManager.ts +0 -177
  113. package/src/hooks/index.ts +0 -1
  114. package/src/index.ts +0 -395
  115. package/src/main.ts +0 -196
  116. package/src/serializers/SerializerRegistry.ts +0 -173
  117. package/src/serializers/index.ts +0 -1
  118. package/src/style.css +0 -96
  119. package/src/styling/LogStyleBuilder.ts +0 -355
  120. package/src/styling/SemanticStyles.ts +0 -380
  121. package/src/styling/SmartPresets.ts +0 -288
  122. package/src/styling/StyleBuilder.ts +0 -319
  123. package/src/styling/StyleCache.ts +0 -131
  124. package/src/styling/banners.ts +0 -168
  125. package/src/styling/index.ts +0 -27
  126. package/src/styling/themes.ts +0 -235
  127. package/src/styling-module.ts +0 -244
  128. package/src/terminal/color-converter.ts +0 -315
  129. package/src/terminal/formatter.ts +0 -236
  130. package/src/terminal/terminal-renderer.ts +0 -342
  131. package/src/transports/ConsoleTransport.ts +0 -28
  132. package/src/transports/FileTransport.ts +0 -53
  133. package/src/transports/HttpTransport.ts +0 -56
  134. package/src/transports/TransportManager.ts +0 -130
  135. package/src/transports/index.ts +0 -4
  136. package/src/types/core.ts +0 -417
  137. package/src/types/handlers.ts +0 -95
  138. package/src/types/hooks.ts +0 -45
  139. package/src/types/index.ts +0 -83
  140. package/src/types/serializers.ts +0 -30
  141. package/src/types/transports.ts +0 -52
  142. package/src/typescript.svg +0 -1
  143. package/src/utils/adapter.ts +0 -291
  144. package/src/utils/ansi-colors.ts +0 -333
  145. package/src/utils/environment-detector.ts +0 -170
  146. package/src/utils/environment.ts +0 -94
  147. package/src/utils/formatting.ts +0 -332
  148. package/src/utils/index.ts +0 -33
  149. package/src/utils/opentui-detection.ts +0 -138
  150. package/src/utils/output.ts +0 -227
  151. package/src/utils/stackTrace.ts +0 -144
  152. package/src/utils/timestamps.ts +0 -80
  153. package/src/vite-env.d.ts +0 -1
  154. package/src/writers/BufferWriter.ts +0 -157
  155. package/src/writers/index.ts +0 -6
  156. package/test-core-browser.html +0 -237
  157. package/test-core-node.js +0 -63
  158. package/tests/test-conflict-resolution.ts +0 -391
  159. package/tests/validate-workflows.sh +0 -131
  160. package/tests/yaml-autofix.sh +0 -146
  161. package/tsconfig.json +0 -50
  162. package/vite.config.ts +0 -256
@@ -1,124 +0,0 @@
1
- /**
2
- * @fileoverview Examples of the new Simplified API for Advanced Logger
3
- */
4
-
5
- import logger, {
6
- preset,
7
- hideTimestamp,
8
- showLocation,
9
- component,
10
- api,
11
- scope,
12
- customize,
13
- styles
14
- } from '../dist/index.js';
15
-
16
- console.log('=== Advanced Logger - Simplified API Examples ===\n');
17
-
18
- // ===== BASIC USAGE - OUT-OF-THE-BOX =====
19
- console.log('1. Basic usage (no configuration needed):');
20
- logger.info('Application started');
21
- logger.success('Database connected');
22
- logger.warn('High memory usage detected');
23
- logger.error('Failed to load configuration');
24
-
25
- console.log('\n2. Available presets:');
26
- console.log('Available presets:', logger.presets());
27
-
28
- // ===== PRESET EXAMPLES =====
29
- console.log('\n3. Using presets:');
30
-
31
- console.log('\n → Cyberpunk preset:');
32
- preset('cyberpunk');
33
- logger.info('System online');
34
- logger.critical('Security breach detected!');
35
-
36
- console.log('\n → Minimal preset:');
37
- preset('minimal');
38
- logger.info('Clean and simple logging');
39
- logger.success('Task completed successfully');
40
-
41
- console.log('\n → Debug preset:');
42
- preset('debug');
43
- logger.debug('Detailed debugging info');
44
- logger.info('Processing data...');
45
-
46
- // Reset to default
47
- preset('default');
48
-
49
- // ===== TOGGLE EXAMPLES =====
50
- console.log('\n4. Toggle features:');
51
-
52
- console.log('\n → Hide timestamp:');
53
- hideTimestamp();
54
- logger.info('No timestamp shown');
55
-
56
- console.log('\n → Show location (with timestamp hidden):');
57
- showLocation();
58
- logger.info('Location info visible');
59
-
60
- // Reset for next examples
61
- logger.showTimestamp();
62
-
63
- // ===== SCOPED LOGGERS =====
64
- console.log('\n5. Scoped loggers:');
65
-
66
- console.log('\n → Component logger:');
67
- const auth = component('UserAuth');
68
- auth.info('Login attempt');
69
- auth.success('User authenticated');
70
- auth.lifecycle('mount', 'Component mounted');
71
- auth.stateChange('idle', 'loading');
72
-
73
- console.log('\n → API logger with badges:');
74
- const graphql = api('GraphQL').badges(['SLOW', 'CACHE']);
75
- graphql.info('Query executed');
76
- graphql.slow('Complex query', 2500);
77
- graphql.auth('Invalid token');
78
-
79
- console.log('\n → Custom scoped logger:');
80
- const payment = scope('Payment').badges(['CRITICAL', 'AUDIT']);
81
- payment.info('Processing payment');
82
- payment.success('Payment completed');
83
-
84
- // ===== CONTEXT EXAMPLES =====
85
- console.log('\n6. Context logging:');
86
- const dbLogger = component('Database');
87
-
88
- dbLogger.context('Migration').run(() => {
89
- dbLogger.info('Starting migration');
90
- dbLogger.success('Tables created');
91
- dbLogger.info('Migration completed');
92
- });
93
- // Context automatically removed after run()
94
-
95
- // ===== SIMPLE CUSTOMIZATION =====
96
- console.log('\n7. Simple customization:');
97
- customize({
98
- message: { color: '#007bff', size: '15px' },
99
- timestamp: { show: true },
100
- location: { show: false }
101
- });
102
-
103
- logger.info('Customized message styling');
104
- logger.success('Custom color and size applied');
105
-
106
- // ===== ADVANCED STYLING (For power users) =====
107
- console.log('\n8. Advanced styling (power users):');
108
-
109
- styles()
110
- .timestamp().muted().mono().compact()
111
- .level().neon().uppercase()
112
- .message().large().system()
113
- .spacing('compact')
114
- .apply();
115
-
116
- logger.info('Advanced custom styling applied');
117
- logger.warn('Neon level badges with large system font');
118
-
119
- console.log('\n=== Examples completed! ===');
120
-
121
- // Reset to clean state for any other examples
122
- preset('default');
123
- logger.showTimestamp();
124
- logger.showLocation();
@@ -1,207 +0,0 @@
1
- /**
2
- * Styling and Themes Example
3
- *
4
- * Demonstrates visual styling capabilities including:
5
- * - Theme switching and customization
6
- * - Custom style creation with StyleBuilder
7
- * - Banner display variations
8
- * - SVG background integration
9
- * - Pre-built style presets
10
- *
11
- * Run: node examples/styling-themes.js
12
- * Note: Best viewed in browser console for full visual effects
13
- */
14
-
15
- import { Logger } from '@mks2508/better-logger';
16
- import {
17
- setTheme,
18
- showBanner,
19
- createStyle,
20
- stylePresets,
21
- logAnimated,
22
- logWithSVG
23
- } from '@mks2508/better-logger/styling';
24
-
25
- console.log('🎨 Better Logger - Styling and Themes Example\n');
26
-
27
- const logger = new Logger({ prefix: 'STYLE' });
28
-
29
- // Theme demonstration
30
- console.log('🌈 Testing different themes:');
31
-
32
- const themes = ['default', 'dark', 'neon', 'cyberpunk', 'retro'];
33
-
34
- for (const theme of themes) {
35
- setTheme(theme);
36
- logger.info(`Theme changed to: ${theme}`);
37
-
38
- // Show some logs in this theme
39
- logger.success(`${theme} theme is active!`);
40
- logger.warn(`Warning message in ${theme} theme`);
41
- logger.error(`Error message in ${theme} theme`);
42
-
43
- console.log(''); // Add spacing
44
- }
45
-
46
- // Banner demonstrations
47
- console.log('\n🎭 Testing different banner types:');
48
-
49
- const bannerTypes = ['simple', 'ascii', 'unicode', 'svg', 'animated'];
50
-
51
- bannerTypes.forEach((type, index) => {
52
- setTimeout(() => {
53
- console.log(`\n--- ${type.toUpperCase()} BANNER ---`);
54
- showBanner(type);
55
- logger.info(`Showing ${type} banner style`);
56
- }, index * 1000);
57
- });
58
-
59
- // Wait for banners, then continue
60
- setTimeout(() => {
61
- console.log('\n✨ Testing custom style creation:');
62
-
63
- // Create custom styles using StyleBuilder
64
- const headerStyle = createStyle()
65
- .bg('linear-gradient(135deg, #667eea, #764ba2)')
66
- .color('white')
67
- .padding('12px 24px')
68
- .rounded('8px')
69
- .bold()
70
- .shadow('0 4px 15px rgba(102, 126, 234, 0.3)')
71
- .build();
72
-
73
- const alertStyle = createStyle()
74
- .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
75
- .color('#333')
76
- .padding('10px 20px')
77
- .border('2px solid #ff5252')
78
- .rounded('25px')
79
- .bold()
80
- .animation('pulse 1s ease-in-out infinite')
81
- .build();
82
-
83
- const codeStyle = createStyle()
84
- .backgroundColor('#2c3e50')
85
- .color('#ecf0f1')
86
- .padding('8px 12px')
87
- .font('Monaco, Consolas, monospace')
88
- .border('1px solid #34495e')
89
- .rounded('4px')
90
- .build();
91
-
92
- console.log('%cCustom Header Style', headerStyle);
93
- console.log('%cCustom Alert Style', alertStyle);
94
- console.log('%cCustom Code Style', codeStyle);
95
-
96
- // Using pre-built style presets
97
- console.log('\n🎯 Testing style presets:');
98
-
99
- console.log('%c✅ Success Preset', stylePresets.success);
100
- console.log('%c❌ Error Preset', stylePresets.error);
101
- console.log('%c⚠️ Warning Preset', stylePresets.warning);
102
- console.log('%cℹ️ Info Preset', stylePresets.info);
103
- console.log('%c🎯 Accent Preset', stylePresets.accent);
104
-
105
- // Advanced styling combinations
106
- console.log('\n🔧 Advanced styling combinations:');
107
-
108
- const gradientButton = createStyle()
109
- .bg('linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c)')
110
- .color('white')
111
- .padding('15px 30px')
112
- .rounded('50px')
113
- .bold()
114
- .shadow('0 8px 25px rgba(102, 126, 234, 0.4)')
115
- .animation('backgroundMove 3s ease infinite')
116
- .css('background-size', '400% 400%')
117
- .build();
118
-
119
- console.log('%c🚀 Gradient Button Style', gradientButton);
120
-
121
- const glassMorphism = createStyle()
122
- .bg('rgba(255, 255, 255, 0.1)')
123
- .color('#333')
124
- .padding('20px')
125
- .rounded('15px')
126
- .border('1px solid rgba(255, 255, 255, 0.2)')
127
- .css('backdrop-filter', 'blur(10px)')
128
- .shadow('0 8px 32px rgba(0, 0, 0, 0.1)')
129
- .build();
130
-
131
- console.log('%c🪟 Glass Morphism Style', glassMorphism);
132
-
133
- // SVG background demonstration (works in browser)
134
- if (typeof document !== 'undefined') {
135
- console.log('\n🖼️ Testing SVG backgrounds:');
136
-
137
- const brandSVG = `
138
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'>
139
- <defs>
140
- <linearGradient id='brandGrad' x1='0%' y1='0%' x2='100%' y2='0%'>
141
- <stop offset='0%' style='stop-color:#667eea'/>
142
- <stop offset='100%' style='stop-color:#764ba2'/>
143
- </linearGradient>
144
- </defs>
145
- <rect width='100%' height='100%' fill='url(#brandGrad)' rx='8'/>
146
- <text x='200' y='45' text-anchor='middle' fill='white'
147
- font-family='Arial' font-size='18' font-weight='bold'>
148
- BETTER LOGGER
149
- </text>
150
- </svg>
151
- `;
152
-
153
- logWithSVG('Custom SVG Background!', brandSVG, {
154
- width: 400,
155
- height: 80,
156
- padding: '40px 200px'
157
- });
158
-
159
- // Animated logging (browser only)
160
- console.log('\n✨ Testing animated logging:');
161
-
162
- logAnimated('🌟 This message has animated gradients!', 3);
163
-
164
- setTimeout(() => {
165
- logAnimated('🎉 Animation completed!', 2);
166
- }, 3500);
167
- }
168
-
169
- // Style combinations for different contexts
170
- console.log('\n📱 Context-specific styling:');
171
-
172
- const mobileStyle = createStyle()
173
- .bg('#007AFF')
174
- .color('white')
175
- .padding('8px 16px')
176
- .rounded('18px')
177
- .fontSize('14px')
178
- .build();
179
-
180
- const desktopStyle = createStyle()
181
- .bg('linear-gradient(135deg, #74b9ff, #0984e3)')
182
- .color('white')
183
- .padding('12px 24px')
184
- .rounded('8px')
185
- .fontSize('16px')
186
- .shadow('0 4px 12px rgba(116, 185, 255, 0.3)')
187
- .build();
188
-
189
- const terminalStyle = createStyle()
190
- .backgroundColor('#1e1e1e')
191
- .color('#00ff00')
192
- .padding('6px 12px')
193
- .font('Fira Code, Monaco, monospace')
194
- .border('1px solid #333')
195
- .build();
196
-
197
- console.log('%c📱 Mobile Style', mobileStyle);
198
- console.log('%c🖥️ Desktop Style', desktopStyle);
199
- console.log('%c💻 Terminal Style', terminalStyle);
200
-
201
- console.log('\n✅ Styling and themes examples completed!');
202
-
203
- // Reset to default theme
204
- setTheme('default');
205
- logger.info('Theme reset to default');
206
-
207
- }, 6000); // Wait for banner demonstrations
package/index.html DELETED
@@ -1,358 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Advanced Logger Test Page - 2025</title>
7
- <style>
8
- * {
9
- margin: 0;
10
- padding: 0;
11
- box-sizing: border-box;
12
- }
13
-
14
- body {
15
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
16
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
17
- min-height: 100vh;
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- padding: 20px;
22
- }
23
-
24
- .container {
25
- background: rgba(255, 255, 255, 0.95);
26
- backdrop-filter: blur(10px);
27
- border-radius: 20px;
28
- padding: 40px;
29
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
30
- max-width: 800px;
31
- width: 100%;
32
- }
33
-
34
- .header {
35
- text-align: center;
36
- margin-bottom: 40px;
37
- }
38
-
39
- .header h1 {
40
- font-size: 2.5rem;
41
- font-weight: 700;
42
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
43
- -webkit-background-clip: text;
44
- -webkit-text-fill-color: transparent;
45
- background-clip: text;
46
- margin-bottom: 10px;
47
- }
48
-
49
- .header p {
50
- color: #6b7280;
51
- font-size: 1.1rem;
52
- margin-bottom: 20px;
53
- }
54
-
55
- .console-note {
56
- background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
57
- border: 1px solid #f59e0b;
58
- border-radius: 12px;
59
- padding: 15px;
60
- margin-bottom: 30px;
61
- text-align: center;
62
- color: #92400e;
63
- font-weight: 500;
64
- }
65
-
66
- .devtools-button {
67
- background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
68
- border: none;
69
- border-radius: 8px;
70
- color: white;
71
- padding: 8px 16px;
72
- margin-top: 10px;
73
- font-size: 12px;
74
- font-weight: 600;
75
- cursor: pointer;
76
- transition: all 0.2s ease;
77
- display: inline-block;
78
- }
79
-
80
- .devtools-button:hover {
81
- background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
82
- transform: translateY(-1px);
83
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
84
- }
85
-
86
- .button-grid {
87
- display: grid;
88
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
89
- gap: 15px;
90
- margin-bottom: 30px;
91
- }
92
-
93
- .log-button {
94
- background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
95
- border: 2px solid #e2e8f0;
96
- border-radius: 12px;
97
- padding: 15px 20px;
98
- font-size: 14px;
99
- font-weight: 600;
100
- cursor: pointer;
101
- transition: all 0.3s ease;
102
- display: flex;
103
- align-items: center;
104
- justify-content: center;
105
- gap: 8px;
106
- min-height: 60px;
107
- }
108
-
109
- .log-button:hover {
110
- transform: translateY(-2px);
111
- box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
112
- }
113
-
114
- .log-button.debug {
115
- border-color: #667eea;
116
- color: #667eea;
117
- }
118
-
119
- .log-button.debug:hover {
120
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
121
- color: white;
122
- }
123
-
124
- .log-button.info {
125
- border-color: #74b9ff;
126
- color: #74b9ff;
127
- }
128
-
129
- .log-button.info:hover {
130
- background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
131
- color: white;
132
- }
133
-
134
- .log-button.warn {
135
- border-color: #fdcb6e;
136
- color: #e17055;
137
- }
138
-
139
- .log-button.warn:hover {
140
- background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
141
- color: white;
142
- }
143
-
144
- .log-button.error {
145
- border-color: #e84393;
146
- color: #e84393;
147
- }
148
-
149
- .log-button.error:hover {
150
- background: linear-gradient(135deg, #e84393 0%, #d63031 100%);
151
- color: white;
152
- }
153
-
154
- .log-button.success {
155
- border-color: #00b894;
156
- color: #00b894;
157
- }
158
-
159
- .log-button.success:hover {
160
- background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
161
- color: white;
162
- }
163
-
164
- .log-button.critical {
165
- border-color: #ff3838;
166
- color: #ff3838;
167
- }
168
-
169
- .log-button.critical:hover {
170
- background: linear-gradient(135deg, #ff3838 0%, #ff1744 100%);
171
- color: white;
172
- }
173
-
174
- .advanced-section {
175
- border-top: 2px solid #e2e8f0;
176
- padding-top: 30px;
177
- margin-top: 30px;
178
- }
179
-
180
- .advanced-section h2 {
181
- color: #374151;
182
- margin-bottom: 20px;
183
- font-size: 1.5rem;
184
- text-align: center;
185
- }
186
-
187
- .footer {
188
- text-align: center;
189
- margin-top: 40px;
190
- color: #6b7280;
191
- font-size: 0.9rem;
192
- }
193
-
194
- @media (max-width: 640px) {
195
- .container {
196
- padding: 20px;
197
- }
198
-
199
- .header h1 {
200
- font-size: 2rem;
201
- }
202
-
203
- .button-grid {
204
- grid-template-columns: 1fr;
205
- }
206
- }
207
- </style>
208
- </head>
209
- <body>
210
- <div class="container">
211
- <header class="header">
212
- <h1>🚀 Better Logger Demo</h1>
213
- <p>Complete library with styling, SVG, animations, export & CLI features</p>
214
- <div class="console-note">
215
- 📝 Open your browser's Developer Console to see the styled log output
216
- <button class="devtools-button" id="devtools-btn" onclick="tryOpenDevTools()">
217
- 🔧 Press F12 to Open DevTools
218
- </button>
219
- <div id="devtools-status" style="margin-top: 8px; font-size: 12px; display: none;">
220
- ✅ DevTools detected! Check the Console tab
221
- </div>
222
- </div>
223
- </header>
224
-
225
- <main>
226
- <section class="button-grid">
227
- <button class="log-button debug" onclick="testDebug()">
228
- 🐞 Debug Log
229
- </button>
230
- <button class="log-button info" onclick="testInfo()">
231
- ℹ️ Info Log
232
- </button>
233
- <button class="log-button warn" onclick="testWarn()">
234
- ⚠️ Warning Log
235
- </button>
236
- <button class="log-button error" onclick="testError()">
237
- ❌ Error Log
238
- </button>
239
- <button class="log-button success" onclick="testSuccess()">
240
- ✅ Success Log
241
- </button>
242
- <button class="log-button critical" onclick="testCritical()">
243
- 🔥 Critical Log
244
- </button>
245
- </section>
246
-
247
- <section class="advanced-section">
248
- <h2>Visual Features</h2>
249
- <div class="button-grid">
250
- <button class="log-button info" onclick="testBanners()">
251
- 🎨 Banner System
252
- </button>
253
- <button class="log-button debug" onclick="testThemes()">
254
- 🌈 Theme Switching
255
- </button>
256
- <button class="log-button success" onclick="testSVG()">
257
- 🖼️ SVG Backgrounds
258
- </button>
259
- <button class="log-button warn" onclick="testAnimations()">
260
- ✨ CSS Animations
261
- </button>
262
- <button class="log-button info" onclick="testCLI()">
263
- 💻 CLI Commands
264
- </button>
265
- <button class="log-button critical" onclick="testExports()">
266
- 📤 Export Features
267
- </button>
268
- </div>
269
- </section>
270
-
271
- <section class="advanced-section">
272
- <h2>Core Features</h2>
273
- <div class="button-grid">
274
- <button class="log-button info" onclick="testTable()">
275
- 📊 Table Display
276
- </button>
277
- <button class="log-button debug" onclick="testGrouping()">
278
- 📁 Grouped Logs
279
- </button>
280
- <button class="log-button warn" onclick="testTiming()">
281
- ⏱️ Performance Timer
282
- </button>
283
- <button class="log-button info" onclick="testScopedLogger()">
284
- 🎯 Scoped Logger
285
- </button>
286
- <button class="log-button debug" onclick="testTrace()">
287
- 🔍 Stack Trace
288
- </button>
289
- <button class="log-button success" onclick="testAllFeatures()">
290
- 🌟 Demo All Features
291
- </button>
292
- </div>
293
- </section>
294
- </main>
295
-
296
- <footer class="footer">
297
- <p>Better Logger v0.0.1 | Built with TypeScript & Modern Web Standards</p>
298
- </footer>
299
- </div>
300
- <script>
301
- let devToolsOpen = false;
302
-
303
- function detectDevTools() {
304
- const threshold = 160;
305
- const widthThreshold = window.outerWidth - window.innerWidth > threshold;
306
- const heightThreshold = window.outerHeight - window.innerHeight > threshold;
307
-
308
- return widthThreshold || heightThreshold;
309
- }
310
-
311
- function updateDevToolsStatus() {
312
- const isOpen = detectDevTools();
313
- const btn = document.getElementById('devtools-btn');
314
- const status = document.getElementById('devtools-status');
315
-
316
- if (isOpen && !devToolsOpen) {
317
- devToolsOpen = true;
318
- btn.textContent = '✅ DevTools Open - Check Console!';
319
- btn.style.background = 'linear-gradient(135deg, #00b894 0%, #00a085 100%)';
320
- status.style.display = 'block';
321
-
322
- // Welcome message when devtools opens
323
- console.log('%c🎉 DevTools Detected! Welcome to Advanced Logger Demo',
324
- 'background: linear-gradient(135deg, #00b894 0%, #00a085 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;');
325
- } else if (!isOpen && devToolsOpen) {
326
- devToolsOpen = false;
327
- btn.textContent = '🔧 Press F12 to Open DevTools';
328
- btn.style.background = 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)';
329
- status.style.display = 'none';
330
- }
331
- }
332
-
333
- function tryOpenDevTools() {
334
- if (!devToolsOpen) {
335
- // Simulate F12 keypress (doesn't actually open devtools, but is educational)
336
- console.log('%c💡 Tip: Press F12 or right-click → Inspect Element to open DevTools!',
337
- 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 10px 15px; border-radius: 5px; font-weight: bold;');
338
-
339
- // Show platform-specific shortcuts
340
- const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
341
- const shortcut = isMac ? 'Cmd+Option+I' : 'F12 or Ctrl+Shift+I';
342
-
343
- alert(`🔧 DevTools Shortcut:\n\n${shortcut}\n\nOnce open, check the Console tab to see styled logs!`);
344
- } else {
345
- console.log('%c🚀 DevTools already open! Check this console for styled logs!',
346
- 'background: linear-gradient(135deg, #00b894 0%, #00a085 100%); color: white; padding: 10px 15px; border-radius: 5px; font-weight: bold;');
347
- }
348
- }
349
-
350
- // Check devtools status every 500ms
351
- setInterval(updateDevToolsStatus, 500);
352
-
353
- // Initial check
354
- setTimeout(updateDevToolsStatus, 100);
355
- </script>
356
- <script type="module" src="./src/main.ts"></script>
357
- </body>
358
- </html>