@mks2508/better-logger 0.0.2-alpha.2 → 0.11.0-alpha.1

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 (247) hide show
  1. package/.github/workflows/ci-quality.yml +357 -0
  2. package/.github/workflows/docs-demo.yml +119 -0
  3. package/.github/workflows/releases-core.yml +512 -0
  4. package/.github/workflows/releases-full.yml +582 -0
  5. package/.github/{workflows → workflows-backup}/ci.yml +12 -110
  6. package/.github/workflows-backup/nightly.yml +196 -0
  7. package/.github/workflows-backup/release-optimized.yml +373 -0
  8. package/.release-notes-0.2.0.md +129 -0
  9. package/.yamllint +28 -0
  10. package/CHANGELOG.json +749 -0
  11. package/CLAUDE.md +92 -1
  12. package/README.md +142 -498
  13. package/bun.lock +323 -0
  14. package/demo.html +9 -2
  15. package/dist/Logger.d.ts +176 -0
  16. package/dist/Logger.d.ts.map +1 -0
  17. package/dist/Logger.js +498 -0
  18. package/dist/chunks/Logger-C2-cR3No.js +2 -0
  19. package/dist/chunks/Logger-C2-cR3No.js.map +1 -0
  20. package/dist/chunks/Logger-CVwk8cgA.js +2159 -0
  21. package/dist/chunks/Logger-CVwk8cgA.js.map +1 -0
  22. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
  23. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
  24. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
  25. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
  26. package/dist/chunks/StyleBuilder-BoJTmskd.js +361 -0
  27. package/dist/chunks/StyleBuilder-BoJTmskd.js.map +1 -0
  28. package/dist/chunks/StyleBuilder-LPLzsoHY.js +4 -0
  29. package/dist/chunks/StyleBuilder-LPLzsoHY.js.map +1 -0
  30. package/dist/cli/CommandProcessor.d.ts +103 -0
  31. package/dist/cli/CommandProcessor.d.ts.map +1 -0
  32. package/dist/cli/CommandProcessor.js +184 -0
  33. package/dist/cli/commands/ConfigCommand.d.ts +17 -0
  34. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
  35. package/dist/cli/commands/ConfigCommand.js +88 -0
  36. package/dist/cli/commands/ExportCommand.d.ts +51 -0
  37. package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
  38. package/dist/cli/commands/ExportCommand.js +243 -0
  39. package/dist/cli/commands/HistoryCommand.d.ts +50 -0
  40. package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
  41. package/dist/cli/commands/HistoryCommand.js +96 -0
  42. package/dist/cli/commands/StatusCommand.d.ts +33 -0
  43. package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
  44. package/dist/cli/commands/StatusCommand.js +93 -0
  45. package/dist/cli/commands/ThemeCommand.d.ts +33 -0
  46. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
  47. package/dist/cli/commands/ThemeCommand.js +79 -0
  48. package/dist/cli/help.d.ts +15 -0
  49. package/dist/cli/help.d.ts.map +1 -0
  50. package/dist/cli/help.js +118 -0
  51. package/dist/cli/index.d.ts +15 -0
  52. package/dist/cli/index.d.ts.map +1 -0
  53. package/dist/cli/index.js +46 -0
  54. package/dist/constants.d.ts +91 -0
  55. package/dist/constants.d.ts.map +1 -0
  56. package/dist/constants.js +80 -0
  57. package/dist/core.cjs +1 -1
  58. package/dist/core.cjs.map +1 -1
  59. package/dist/core.d.ts +130 -0
  60. package/dist/core.d.ts.map +1 -0
  61. package/dist/core.js +258 -242
  62. package/dist/core.js.map +1 -1
  63. package/dist/example.d.ts +18 -0
  64. package/dist/example.d.ts.map +1 -0
  65. package/dist/example.js +154 -0
  66. package/dist/exports-module.d.ts +203 -0
  67. package/dist/exports-module.d.ts.map +1 -0
  68. package/dist/exports-module.js +260 -0
  69. package/dist/exports.cjs +1 -1
  70. package/dist/exports.cjs.map +1 -1
  71. package/dist/exports.js +2 -2
  72. package/dist/handlers/AnalyticsLogHandler.d.ts +11 -0
  73. package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  74. package/dist/handlers/AnalyticsLogHandler.js +19 -0
  75. package/dist/handlers/ExportLogHandler.d.ts +103 -0
  76. package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
  77. package/dist/handlers/ExportLogHandler.js +516 -0
  78. package/dist/handlers/FileLogHandler.d.ts +13 -0
  79. package/dist/handlers/FileLogHandler.d.ts.map +1 -0
  80. package/dist/handlers/FileLogHandler.js +24 -0
  81. package/dist/handlers/RemoteLogHandler.d.ts +14 -0
  82. package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
  83. package/dist/handlers/RemoteLogHandler.js +37 -0
  84. package/dist/handlers/index.d.ts +8 -0
  85. package/dist/handlers/index.d.ts.map +1 -0
  86. package/dist/handlers/index.js +7 -0
  87. package/dist/index.cjs +1 -1
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.d.ts +86 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +89 -103
  92. package/dist/main.d.ts +2 -0
  93. package/dist/main.d.ts.map +1 -0
  94. package/dist/main.js +139 -0
  95. package/dist/styling/StyleBuilder.d.ts +132 -0
  96. package/dist/styling/StyleBuilder.d.ts.map +1 -0
  97. package/dist/styling/StyleBuilder.js +268 -0
  98. package/dist/styling/banners.d.ts +45 -0
  99. package/dist/styling/banners.d.ts.map +1 -0
  100. package/dist/styling/banners.js +155 -0
  101. package/dist/styling/index.d.ts +7 -0
  102. package/dist/styling/index.d.ts.map +1 -0
  103. package/dist/styling/index.js +6 -0
  104. package/dist/styling/themes.d.ts +10 -0
  105. package/dist/styling/themes.d.ts.map +1 -0
  106. package/dist/styling/themes.js +231 -0
  107. package/dist/styling-module.d.ts +185 -0
  108. package/dist/styling-module.d.ts.map +1 -0
  109. package/dist/styling-module.js +199 -0
  110. package/dist/styling.cjs +1 -1
  111. package/dist/styling.cjs.map +1 -1
  112. package/dist/styling.js +4 -4
  113. package/dist/types/Logger.d.ts +172 -0
  114. package/dist/types/Logger.d.ts.map +1 -0
  115. package/dist/types/cli/CommandProcessor.d.ts +100 -0
  116. package/dist/types/cli/CommandProcessor.d.ts.map +1 -0
  117. package/dist/types/cli/commands/ConfigCommand.d.ts +14 -0
  118. package/dist/types/cli/commands/ConfigCommand.d.ts.map +1 -0
  119. package/dist/types/cli/commands/ExportCommand.d.ts +48 -0
  120. package/dist/types/cli/commands/ExportCommand.d.ts.map +1 -0
  121. package/dist/types/cli/commands/HistoryCommand.d.ts +47 -0
  122. package/dist/types/cli/commands/HistoryCommand.d.ts.map +1 -0
  123. package/dist/types/cli/commands/StatusCommand.d.ts +30 -0
  124. package/dist/types/cli/commands/StatusCommand.d.ts.map +1 -0
  125. package/dist/types/cli/commands/ThemeCommand.d.ts +30 -0
  126. package/dist/types/cli/commands/ThemeCommand.d.ts.map +1 -0
  127. package/dist/types/cli/help.d.ts +12 -0
  128. package/dist/types/cli/help.d.ts.map +1 -0
  129. package/dist/types/cli/index.d.ts +15 -0
  130. package/dist/types/cli/index.d.ts.map +1 -0
  131. package/dist/types/constants.d.ts +88 -0
  132. package/dist/types/constants.d.ts.map +1 -0
  133. package/dist/types/core.d.ts +71 -211
  134. package/dist/types/core.d.ts.map +1 -0
  135. package/dist/types/core.js +13 -0
  136. package/dist/types/example.d.ts +18 -0
  137. package/dist/types/example.d.ts.map +1 -0
  138. package/dist/types/exports-module.d.ts +196 -0
  139. package/dist/types/exports-module.d.ts.map +1 -0
  140. package/dist/types/handlers/AnalyticsLogHandler.d.ts +8 -0
  141. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  142. package/dist/types/handlers/ExportLogHandler.d.ts +100 -0
  143. package/dist/types/handlers/ExportLogHandler.d.ts.map +1 -0
  144. package/dist/types/handlers/FileLogHandler.d.ts +10 -0
  145. package/dist/types/handlers/FileLogHandler.d.ts.map +1 -0
  146. package/dist/types/handlers/RemoteLogHandler.d.ts +11 -0
  147. package/dist/types/handlers/RemoteLogHandler.d.ts.map +1 -0
  148. package/dist/types/handlers/index.d.ts +8 -0
  149. package/dist/types/handlers/index.d.ts.map +1 -0
  150. package/dist/types/handlers.d.ts +88 -0
  151. package/dist/types/handlers.d.ts.map +1 -0
  152. package/dist/types/handlers.js +4 -0
  153. package/dist/types/index.d.ts +7 -675
  154. package/dist/types/index.d.ts.map +1 -0
  155. package/dist/types/index.js +4 -0
  156. package/dist/types/main.d.ts +2 -0
  157. package/dist/types/main.d.ts.map +1 -0
  158. package/dist/types/styling/StyleBuilder.d.ts +132 -0
  159. package/dist/types/styling/StyleBuilder.d.ts.map +1 -0
  160. package/dist/types/styling/banners.d.ts +42 -0
  161. package/dist/types/styling/banners.d.ts.map +1 -0
  162. package/dist/types/styling/index.d.ts +7 -0
  163. package/dist/types/styling/index.d.ts.map +1 -0
  164. package/dist/types/styling/themes.d.ts +7 -0
  165. package/dist/types/styling/themes.d.ts.map +1 -0
  166. package/dist/types/styling-module.d.ts +178 -0
  167. package/dist/types/styling-module.d.ts.map +1 -0
  168. package/dist/types/types/core.d.ts +71 -0
  169. package/dist/types/types/core.d.ts.map +1 -0
  170. package/dist/types/types/handlers.d.ts +85 -0
  171. package/dist/types/types/handlers.d.ts.map +1 -0
  172. package/dist/types/types/index.d.ts +7 -0
  173. package/dist/types/types/index.d.ts.map +1 -0
  174. package/dist/types/utils/index.d.ts +7 -0
  175. package/dist/types/utils/index.d.ts.map +1 -0
  176. package/dist/types/utils/output.d.ts +29 -0
  177. package/dist/types/utils/output.d.ts.map +1 -0
  178. package/dist/types/utils/stackTrace.d.ts +6 -0
  179. package/dist/types/utils/stackTrace.d.ts.map +1 -0
  180. package/dist/types/utils/timestamps.d.ts +20 -0
  181. package/dist/types/utils/timestamps.d.ts.map +1 -0
  182. package/dist/utils/index.d.ts +7 -0
  183. package/dist/utils/index.d.ts.map +1 -0
  184. package/dist/utils/index.js +6 -0
  185. package/dist/utils/output.d.ts +32 -0
  186. package/dist/utils/output.d.ts.map +1 -0
  187. package/dist/utils/output.js +97 -0
  188. package/dist/utils/stackTrace.d.ts +9 -0
  189. package/dist/utils/stackTrace.d.ts.map +1 -0
  190. package/dist/utils/stackTrace.js +81 -0
  191. package/dist/utils/timestamps.d.ts +20 -0
  192. package/dist/utils/timestamps.d.ts.map +1 -0
  193. package/dist/utils/timestamps.js +71 -0
  194. package/docs/API.md +691 -0
  195. package/docs/DEVELOPMENT.md +731 -0
  196. package/docs/PACKAGES.md +244 -0
  197. package/docs/_config.yml +36 -0
  198. package/docs/index.md +179 -0
  199. package/examples/README.md +208 -0
  200. package/examples/basic-logging.js +75 -0
  201. package/examples/data-export.js +234 -0
  202. package/examples/package.json +16 -0
  203. package/examples/performance-timing.js +170 -0
  204. package/examples/styling-themes.js +207 -0
  205. package/package.json +32 -21
  206. package/packages/core/package.json +35 -0
  207. package/packages/exports/package.json +41 -0
  208. package/packages/styling/package.json +41 -0
  209. package/project-utils/README.md +172 -0
  210. package/project-utils/auto-release-gemini.ts +1193 -0
  211. package/project-utils/commit-generator.ts +1385 -0
  212. package/project-utils/commit-ui.ts +264 -0
  213. package/project-utils/git-utils.ts +199 -0
  214. package/project-utils/github-release-manager.ts +466 -0
  215. package/project-utils/prompt-templates.js +345 -0
  216. package/project-utils/prompt-templates.ts +422 -0
  217. package/project-utils/version-manager.ts +1078 -0
  218. package/src/Logger.ts +2 -1
  219. package/src/cli/CommandProcessor.ts +173 -2
  220. package/src/cli/commands/HistoryCommand.ts +117 -0
  221. package/src/cli/index.ts +12 -0
  222. package/src/handlers/ExportLogHandler.ts +141 -0
  223. package/tests/test-conflict-resolution.ts +391 -0
  224. package/tests/validate-workflows.sh +131 -0
  225. package/tests/yaml-autofix.sh +146 -0
  226. package/vite.config.ts +152 -50
  227. package/.claude/settings.local.json +0 -22
  228. package/.npmrc.bak +0 -1
  229. package/dist/chunks/Logger-BQhMKy_T.js +0 -2
  230. package/dist/chunks/Logger-BQhMKy_T.js.map +0 -1
  231. package/dist/chunks/Logger-BrFKFZcD.js +0 -978
  232. package/dist/chunks/Logger-BrFKFZcD.js.map +0 -1
  233. package/dist/chunks/core-2opW4Pi3.js +0 -194
  234. package/dist/chunks/core-2opW4Pi3.js.map +0 -1
  235. package/dist/chunks/core-DyugwSYZ.js +0 -4
  236. package/dist/chunks/core-DyugwSYZ.js.map +0 -1
  237. package/dist/chunks/exports-BNP3R7dp.js +0 -421
  238. package/dist/chunks/exports-BNP3R7dp.js.map +0 -1
  239. package/dist/chunks/exports-U1xLBXrY.js +0 -2
  240. package/dist/chunks/exports-U1xLBXrY.js.map +0 -1
  241. package/dist/chunks/styling-DhUDzwlE.js +0 -654
  242. package/dist/chunks/styling-DhUDzwlE.js.map +0 -1
  243. package/dist/chunks/styling-tmRDI28D.js +0 -2
  244. package/dist/chunks/styling-tmRDI28D.js.map +0 -1
  245. package/dist/types/exports.d.ts +0 -600
  246. package/dist/types/styling.d.ts +0 -751
  247. /package/.github/{workflows → workflows-backup}/release.yml +0 -0
package/README.md CHANGED
@@ -1,577 +1,221 @@
1
- <div align="center">
2
-
3
- # 🚀 Better Logger
4
-
5
- **State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface**
6
-
7
- [![Version](https://img.shields.io/badge/version-0.0.1-blue?style=for-the-badge)](https://github.com/MKS2508/advanced-logger/releases)
8
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.8+-blue?style=for-the-badge&logo=typescript)](https://typescriptlang.org)
9
- [![Build Size](https://img.shields.io/badge/Bundle%20Size-64KB-green?style=for-the-badge)](https://bundlephobia.com)
10
- [![License](https://img.shields.io/badge/license-MIT-orange?style=for-the-badge)](LICENSE)
11
- [![Platform](https://img.shields.io/badge/Platform-Browser%20|%20Node.js-brightgreen?style=for-the-badge)](https://nodejs.org)
12
-
13
- *Transform your logging experience with advanced visual features, modular architecture, and enterprise-grade performance*
14
-
15
- </div>
1
+ # 🚀 Better Logger
16
2
 
17
- ---
3
+ **State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface**
18
4
 
19
- ## 🌟 Features
5
+ [![NPM Version](https://img.shields.io/npm/v/@mks2508/better-logger)](https://www.npmjs.com/package/@mks2508/better-logger)
6
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@mks2508/better-logger)](https://bundlephobia.com/package/@mks2508/better-logger)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)
8
+ [![License](https://img.shields.io/npm/l/@mks2508/better-logger)](https://github.com/MKS2508/advanced-logger/blob/main/LICENSE)
20
9
 
21
- | **Visual Excellence** | **Performance & Architecture** | **Developer Experience** |
22
- |:---------------------|:-------------------------------|:-------------------------|
23
- | 🎨 **Advanced CSS Styling** | ⚡ **64KB Full Bundle** | 💻 **CLI Interface** |
24
- | 🖼️ **SVG Background Support** | 🎯 **Tree-Shakeable Modules** | 🔧 **TypeScript First** |
25
- | ✨ **CSS Animations** | 🚀 **<13KB Gzipped** | 📦 **Modular Imports** |
26
- | 🌈 **Theme System** | 💾 **Minimal Memory** | 🛠️ **Hot Reload** |
27
- | 🎭 **Multi-Banner Types** | 📊 **Export Capabilities** | 🔍 **Stack Trace** |
10
+ Transform your console logging experience with beautiful styling, professional themes, and advanced features that make debugging and monitoring a visual delight.
28
11
 
29
- ## 🚀 Quick Start
12
+ ## ✨ Features
30
13
 
31
- ```bash
32
- # Install the package
33
- npm install @mks2508/better-logger
14
+ - 🎨 **Advanced CSS Styling** - Beautiful gradients, shadows, and animations
15
+ - 🌈 **5 Professional Themes** - Default, Dark, Neon, Cyberpunk, Retro
16
+ - 🖼️ **SVG Background Support** - Custom graphics in console output
17
+ - ⚡ **Performance Monitoring** - Built-in timing and benchmarking
18
+ - 📊 **Data Export** - CSV, JSON, XML export with filtering
19
+ - 📡 **Remote Logging** - Send logs to external services
20
+ - 💻 **Interactive CLI** - Built-in command interface
21
+ - 🔧 **Modular Architecture** - Import only what you need
22
+ - 📱 **Universal Compatibility** - Browser & Node.js with graceful fallbacks
23
+ - 🎯 **TypeScript First** - Complete type safety and IntelliSense
34
24
 
35
- # Basic usage
36
- import logger from '@mks2508/better-logger'
25
+ ## 📦 Installation
37
26
 
38
- logger.info('Hello, beautiful logs! 🎉')
39
- logger.success('Operation completed successfully')
40
- logger.error('Something went wrong', error)
27
+ ### Full Package (Recommended)
28
+ ```bash
29
+ npm install @mks2508/better-logger
41
30
  ```
42
31
 
43
- ### Modular Imports
32
+ ### Modular Installation
33
+ Choose only the functionality you need:
44
34
 
45
- ```typescript
46
- // Core logging only (~6KB)
47
- import { debug, info, warn, error } from '@mks2508/better-logger/core'
35
+ ```bash
36
+ # Core logging only (~15KB)
37
+ npm install @mks2508/better-logger-core
48
38
 
49
- // With advanced styling (~26KB)
50
- import { logAnimated, setTheme } from '@mks2508/better-logger/styling'
39
+ # Add styling capabilities (~12KB)
40
+ npm install @mks2508/better-logger-styling
51
41
 
52
- // With export capabilities (~12KB)
53
- import { exportLogs } from '@mks2508/better-logger/exports'
42
+ # Add export handlers (~18KB)
43
+ npm install @mks2508/better-logger-exports
54
44
  ```
55
45
 
56
- ## ✨ Visual Showcase
57
-
58
- ### Theme System
59
- ```typescript
60
- import { setTheme, showBanner } from '@mks2508/better-logger'
61
-
62
- // Apply theme with visual banner
63
- setTheme('cyberpunk') // neon, dark, retro, cyberpunk
64
- showBanner('animated') // simple, ascii, unicode, svg, animated
65
-
66
- logger.info('Themed logging experience! 🌈')
67
- ```
46
+ > 📋 **[View Complete Packages Guide →](https://mks2508.github.io/advanced-logger/packages/)**
68
47
 
69
- ### SVG Backgrounds
70
- ```typescript
71
- import { logWithSVG } from '@mks2508/better-logger'
72
-
73
- const customSVG = `<svg>...</svg>`
74
- logWithSVG('Custom branded message', customSVG, {
75
- width: 400,
76
- height: 80,
77
- padding: '40px 200px'
78
- })
79
- ```
48
+ ## 🚀 Quick Start
80
49
 
81
- ### CSS Animations
82
50
  ```typescript
83
- import { logAnimated } from '@mks2508/better-logger'
84
-
85
- logAnimated('🚀 Loading with style...', 3) // 3 second animation
86
- ```
51
+ import { Logger } from '@mks2508/better-logger';
87
52
 
88
- ## 📦 Bundle Analysis
53
+ const logger = new Logger({ prefix: 'APP' });
89
54
 
90
- > **Optimized for modern applications with intelligent code splitting**
55
+ // Beautiful styled logging
56
+ logger.info('Application started', { version: '1.0.0' });
57
+ logger.success('Database connected successfully');
58
+ logger.warn('Memory usage high', { usage: '85%' });
59
+ logger.error('API request failed', { status: 500 });
91
60
 
61
+ // Performance timing
62
+ logger.time('operation');
63
+ await performOperation();
64
+ logger.timeEnd('operation'); // Shows duration with beautiful styling
92
65
  ```
93
- ┌─────────────────┬─────────┬──────────┬─────────────────┐
94
- │ Import │ Bundle │ Gzipped │ Use Case │
95
- ├─────────────────┼─────────┼──────────┼─────────────────┤
96
- │ /core │ 6KB │ 2KB │ Basic logging │
97
- │ /styling │ 26KB │ 5KB │ Visual features │
98
- │ /exports │ 12KB │ 3KB │ Data export │
99
- │ Full library │ 64KB │ 13KB │ All features │
100
- └─────────────────┴─────────┴──────────┴─────────────────┘
101
- ```
102
-
103
- <details>
104
- <summary><b>📊 Detailed Size Breakdown</b></summary>
105
-
106
- **ESM Build (Production)**
107
- - Main entry: 3.1 KB
108
- - Logger chunk: 34.5 KB (CSS styling, banners, SVG, animations)
109
- - Styling chunk: 20.1 KB (themes, visual effects)
110
- - Core utilities: 6.0 KB (stack trace, timestamps, handlers)
111
-
112
- **CJS Build (Minified)**
113
- - index.cjs: 2.1 KB (gzip: 0.8 KB)
114
- - core.cjs: 3.2 KB (gzip: 1.3 KB)
115
- - styling.cjs: 1.9 KB (gzip: 0.7 KB)
116
- - exports.cjs: 2.6 KB (gzip: 0.9 KB)
117
-
118
- </details>
119
-
120
- ## 🏗️ Architecture
121
-
122
- ```mermaid
123
- graph TD
124
- A[Better Logger] --> B[Core Module]
125
- A --> C[Styling Module]
126
- A --> D[Exports Module]
127
-
128
- B --> E[Basic Logging]
129
- B --> F[Scoped Loggers]
130
- B --> G[Performance Timers]
131
-
132
- C --> H[Theme System]
133
- C --> I[SVG Support]
134
- C --> J[Animations]
135
- C --> K[Banner Types]
136
-
137
- D --> L[CSV/JSON/XML Export]
138
- D --> M[Remote Logging]
139
- D --> N[Buffer Management]
140
- ```
141
-
142
- ## 🎯 Module Guide
143
66
 
144
- <table>
145
- <tr>
146
- <td width="33%" valign="top">
67
+ ## 🔧 Enhanced CLI Interface
147
68
 
148
- ### 📦 Core Module
149
- **Lightweight • Essential features only**
69
+ New in v0.1.0-rc.1! Interactive CLI with plugin support and command history:
150
70
 
151
71
  ```typescript
152
- import {
153
- debug, info, warn, error,
154
- createScopedLogger,
155
- time, timeEnd
156
- } from '@mks2508/better-logger/core'
157
-
158
- const api = createScopedLogger('API')
159
- api.time('request')
160
- api.info('Fetching data...')
161
- api.timeEnd('request')
162
- ```
72
+ import { Logger } from '@mks2508/better-logger';
163
73
 
164
- **Size: 6KB • Perfect for libraries**
74
+ const logger = new Logger();
165
75
 
166
- </td>
167
- <td width="33%" valign="top">
76
+ // Enter interactive mode
77
+ logger.executeCommand('/interactive');
168
78
 
169
- ### 🎨 Styling Module
170
- **Visual • Themes & animations**
79
+ // Use enhanced CLI in browser console:
80
+ cli('help'); // Show all commands
81
+ cli('theme cyberpunk'); // Change theme
82
+ cli('history 5'); // View command history
83
+ cli('plugins'); // List loaded plugins
171
84
 
172
- ```typescript
173
- import {
174
- setTheme, logAnimated,
175
- logWithSVG, showBanner,
176
- createStyle
177
- } from '@mks2508/better-logger/styling'
178
-
179
- setTheme('neon')
180
- showBanner('svg')
181
-
182
- const style = createStyle()
183
- .bg('linear-gradient(...)')
184
- .build()
85
+ // Create custom plugins
86
+ const myPlugin = {
87
+ name: 'analytics',
88
+ commands: [{
89
+ name: 'track',
90
+ execute: (args, logger) => logger.info(`Tracking: ${args}`)
91
+ }]
92
+ };
93
+ logger.cliProcessor.registerPlugin(myPlugin);
185
94
  ```
186
95
 
187
- **Size: 26KB • Rich visual experience**
188
-
189
- </td>
190
- <td width="33%" valign="top">
96
+ ## 🔧 Modular Usage
191
97
 
192
- ### 📤 Exports Module
193
- **Data management • Export capabilities**
98
+ Import only what you need for optimal bundle sizes:
194
99
 
195
100
  ```typescript
196
- import {
197
- ExportLogger,
198
- exportLogs, addRemoteHandler
199
- } from '@mks2508/better-logger/exports'
101
+ // Core logging only (6KB) - Essential features
102
+ import { Logger } from '@mks2508/better-logger/core';
200
103
 
201
- const logger = new ExportLogger({
202
- bufferSize: 1000
203
- })
104
+ // Styling features (26KB) - Themes, SVG, animations
105
+ import { setTheme, logAnimated } from '@mks2508/better-logger/styling';
204
106
 
205
- const csvData = await exportLogs('csv')
206
- addRemoteHandler('https://api.logs.com')
107
+ // Export capabilities (12KB) - Data export, remote logging
108
+ import { ExportLogger } from '@mks2508/better-logger/exports';
207
109
  ```
208
110
 
209
- **Size: 12KB • Enterprise features**
111
+ ## 📊 Bundle Analysis
210
112
 
211
- </td>
212
- </tr>
213
- </table>
113
+ | Module | Size | Gzipped | Best For |
114
+ |--------|------|---------|----------|
115
+ | **Core** | 6KB | 2KB | Essential logging, Node.js apps |
116
+ | **Styling** | 26KB | 5KB | Frontend apps, visual debugging |
117
+ | **Exports** | 12KB | 3KB | Production logging, analytics |
118
+ | **Full** | 64KB | 13KB | Complete feature set |
214
119
 
215
- ## 💻 API Reference
120
+ ## 📚 Documentation & Learning
216
121
 
217
- ### Basic Logging
218
- ```typescript
219
- logger.debug('Debug information', { data: 'object' })
220
- logger.info('📋 General information')
221
- logger.warn('⚠️ Warning message')
222
- logger.error('❌ Error occurred', error)
223
- logger.success('✅ Operation successful')
224
- logger.critical('🔥 Critical system error')
225
- ```
122
+ ### 📖 Complete Documentation
123
+ - **[📋 API Reference](docs/API.md)** - Complete method documentation
124
+ - **[🚀 Core Module](docs/CORE.md)** - Essential logging features
125
+ - **[🎨 Styling Module](docs/STYLING.md)** - Themes and visual customization
126
+ - **[📤 Exports Module](docs/EXPORTS.md)** - Data export and remote logging
226
127
 
227
- ### Advanced Features
228
- ```typescript
229
- // Performance timing
230
- logger.time('operation')
231
- // ... code execution
232
- logger.timeEnd('operation') // Logs: operation: 245.67ms
233
-
234
- // Data tables
235
- logger.table([
236
- { name: 'Alice', role: 'Admin' },
237
- { name: 'Bob', role: 'User' }
238
- ])
239
-
240
- // Grouped logging
241
- logger.group('User Session')
242
- logger.info('Login successful')
243
- logger.warn('Password expires soon')
244
- logger.groupEnd()
245
-
246
- // Stack traces
247
- logger.trace('Deep debugging information')
248
- ```
128
+ ### 🎮 Interactive Learning
129
+ - **[🌟 Live Demo](https://mks2508.github.io/advanced-logger/)** - Try all features in your browser
130
+ - **[📁 Examples](examples/)** - 4 comprehensive tutorials with runnable code
249
131
 
250
- ### CLI System
251
- ```typescript
252
- // Interactive command interface
253
- logger.cli('/help') // Show available commands
254
- logger.cli('/theme neon') // Change theme
255
- logger.cli('/banner ascii') // Change banner type
256
- logger.cli('/export csv') // Export logs as CSV
257
- logger.cli('/status') // Show logger status
132
+ ### 🏃 Quick Examples
133
+ ```bash
134
+ cd examples && npm install
135
+ npm run basic # Learn fundamentals
136
+ npm run performance # Master timing operations
137
+ npm run styling # Explore visual features
138
+ npm run export # Data management
258
139
  ```
259
140
 
260
- ## 🎨 Styling API
141
+ ## 🎨 Visual Showcase
261
142
 
262
- ### Custom Styles
143
+ ### Professional Themes
263
144
  ```typescript
264
- import { createStyle, stylePresets } from '@mks2508/better-logger'
265
-
266
- // Build custom style
267
- const myStyle = createStyle()
268
- .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
269
- .color('white')
270
- .padding('12px 20px')
271
- .rounded('10px')
272
- .shadow('0 4px 15px rgba(0,0,0,0.3)')
273
- .bold()
274
- .build()
275
-
276
- console.log('%cCustom Message', myStyle)
145
+ import { setTheme } from '@mks2508/better-logger/styling';
277
146
 
278
- // Use presets
279
- console.log('%cSuccess!', stylePresets.success)
280
- console.log('%cError!', stylePresets.error)
147
+ setTheme('cyberpunk'); // Purple/pink futuristic
148
+ setTheme('neon'); // Bright electric colors
149
+ setTheme('dark'); // Dark mode optimized
281
150
  ```
282
151
 
283
- ### Theme Configuration
152
+ ### Custom Styling
284
153
  ```typescript
285
- // Available themes
286
- const themes = ['default', 'dark', 'neon', 'cyberpunk', 'retro']
154
+ import { createStyle } from '@mks2508/better-logger/styling';
287
155
 
288
- // Set theme with banner
289
- setTheme('cyberpunk') // Automatically shows themed banner
156
+ const customStyle = createStyle()
157
+ .bg('linear-gradient(45deg, #667eea, #764ba2)')
158
+ .color('white')
159
+ .padding('12px 24px')
160
+ .rounded('8px')
161
+ .shadow('0 4px 15px rgba(102, 126, 234, 0.4)')
162
+ .build();
290
163
 
291
- // Manual banner display
292
- showBanner('animated') // simple, ascii, unicode, svg, animated
164
+ console.log('%c🚀 Beautiful Custom Style!', customStyle);
293
165
  ```
294
166
 
295
- ## 📊 Export & Remote Logging
167
+ ## ⚡ Advanced Features
296
168
 
297
- ### Export Capabilities
169
+ ### CLI Interface
298
170
  ```typescript
299
- import { ExportLogger } from '@mks2508/better-logger/exports'
300
-
301
- const logger = new ExportLogger({ bufferSize: 1000 })
302
-
303
- // Export in different formats
304
- const csvData = await logger.exportLogs('csv')
305
- const jsonData = await logger.exportLogs('json', {
306
- filter: { level: 'error' },
307
- limit: 100
308
- })
171
+ import { initializeCLI } from '@mks2508/better-logger/cli';
172
+ initializeCLI(logger);
309
173
 
310
- // Get statistics
311
- const stats = logger.getLogStats()
312
- console.log(`Errors: ${stats.error}, Warnings: ${stats.warn}`)
174
+ // Available in browser console:
175
+ // /help /theme /export /clear /status
313
176
  ```
314
177
 
315
- ### Remote Logging
178
+ ### Performance Monitoring
316
179
  ```typescript
317
- // Add remote endpoints
318
- logger.addRemoteHandler('https://api.logs.company.com', 'api-key')
319
- logger.addRemoteHandler('wss://realtime-logs.com/stream')
320
-
321
- // Logs are automatically sent to remote endpoints
322
- logger.error('This will be sent to remote servers')
323
-
324
- // Flush pending logs
325
- await logger.flushRemoteHandlers()
180
+ logger.time('api-request');
181
+ const result = await fetch('/api/data');
182
+ logger.timeEnd('api-request'); // Automatic duration display
326
183
  ```
327
184
 
328
- ## 🔧 Configuration
329
-
330
- ### Logger Configuration
185
+ ### Data Export
331
186
  ```typescript
332
- import { Logger } from '@mks2508/better-logger'
333
-
334
- const logger = new Logger({
335
- verbosity: 'info', // debug, info, warn, error, critical, silent
336
- enableColors: true, // Enable CSS styling
337
- enableTimestamps: true, // Add timestamps to logs
338
- enableStackTrace: false, // Include stack trace info
339
- globalPrefix: 'MyApp', // Global prefix for all logs
340
- bufferSize: 1000, // Enable export functionality
341
- theme: 'neon', // Default theme
342
- bannerType: 'svg' // Banner type for initialization
343
- })
344
- ```
187
+ import { ExportLogger } from '@mks2508/better-logger/exports';
345
188
 
346
- ### Environment Variables
347
- ```bash
348
- # .env configuration
349
- LOGGER_VERBOSITY=debug
350
- LOGGER_ENABLE_COLORS=true
351
- LOGGER_THEME=cyberpunk
352
- LOGGER_BUFFER_SIZE=2000
353
- ```
354
-
355
- ## ⚡ Performance
356
-
357
- > **Benchmarked on Chrome 120, Node.js 20, 1000 log entries**
358
-
359
- ```
360
- ┌─────────────────┬──────────┬──────────┬─────────────────┐
361
- │ Operation │ Time │ Memory │ vs Console.log │
362
- ├─────────────────┼──────────┼──────────┼─────────────────┤
363
- │ Basic Logging │ 0.12ms │ +2MB │ 1.5x slower │
364
- │ Styled Logging │ 0.35ms │ +5MB │ 2.8x slower │
365
- │ SVG Backgrounds │ 1.2ms │ +8MB │ 5x slower │
366
- │ Buffer Export │ 15ms │ +10MB │ N/A │
367
- └─────────────────┴──────────┴──────────┴─────────────────┘
368
- ```
369
-
370
- **Memory Usage:**
371
- - Core module: <2MB additional RAM
372
- - Full library: <15MB additional RAM
373
- - Buffer (1000 entries): ~3MB
374
- - Themes & styling: ~2MB
375
-
376
- ## 🛠️ Development
377
-
378
- ### Setup
379
- ```bash
380
- # Clone repository
381
- git clone https://github.com/MKS2508/advanced-logger.git
382
- cd advanced-logger
383
-
384
- # Install dependencies
385
- npm install
386
-
387
- # Development server
388
- npm run dev
389
- ```
390
-
391
- ### Build System
392
- ```bash
393
- npm run build # Production build (ESM + CJS)
394
- npm run build:watch # Development build with watch
395
- npm run preview # Preview built library
396
- ```
397
-
398
- **Build Output:**
399
- - ESM modules in `dist/*.js`
400
- - CJS modules in `dist/*.cjs`
401
- - TypeScript declarations in `dist/types/`
402
- - Source maps for debugging
403
-
404
- ### Testing
405
- ```bash
406
- # Interactive testing (browser)
407
- npm run dev
408
- # Open http://localhost:5173
409
-
410
- # Run specific tests
411
- npm run test:core # Core module tests
412
- npm run test:styling # Styling tests
413
- npm run test:exports # Export functionality
414
- ```
415
-
416
- <details>
417
- <summary><b>📁 Project Structure</b></summary>
418
-
419
- ```
420
- advanced-logger/
421
- ├── src/
422
- │ ├── index.ts # Main entry - full library
423
- │ ├── core.ts # Core module - minimal logging
424
- │ ├── styling-module.ts # Styling module - visual features
425
- │ ├── exports-module.ts # Exports module - data management
426
- │ │
427
- │ ├── Logger.ts # Core Logger implementation
428
- │ ├── types/ # TypeScript type definitions
429
- │ ├── utils/ # Utility functions
430
- │ ├── styling/ # Styling system
431
- │ ├── handlers/ # Log handlers
432
- │ ├── cli/ # CLI command system
433
- │ └── constants.ts # Configuration constants
434
- │
435
- ├── dist/ # Built library files
436
- │ ├── *.js # ESM builds
437
- │ ├── *.cjs # CommonJS builds
438
- │ ├── chunks/ # Code-split chunks
439
- │ └── types/ # TypeScript declarations
440
- │
441
- ├── examples/ # Usage examples
442
- ├── tests/ # Test suites
443
- └── docs/ # Documentation
444
- ```
445
-
446
- </details>
447
-
448
- ## 📚 Examples
449
-
450
- ### Enterprise Dashboard
451
- ```typescript
452
- import logger, { createScopedLogger } from '@mks2508/better-logger'
453
- import { setTheme } from '@mks2508/better-logger/styling'
454
-
455
- // Configure for enterprise use
456
- setTheme('dark')
457
- logger.setGlobalPrefix('DASHBOARD')
458
-
459
- const apiLogger = createScopedLogger('API')
460
- const dbLogger = createScopedLogger('DATABASE')
461
- const authLogger = createScopedLogger('AUTH')
462
-
463
- // Structured logging with scoped contexts
464
- apiLogger.time('user-fetch')
465
- apiLogger.info('Fetching user data', { userId: 12345 })
466
-
467
- dbLogger.debug('SQL Query', {
468
- query: 'SELECT * FROM users WHERE id = ?',
469
- params: [12345]
470
- })
471
-
472
- authLogger.success('User authenticated', {
473
- user: 'john.doe@company.com',
474
- role: 'admin'
475
- })
476
-
477
- apiLogger.timeEnd('user-fetch') // Logs: API user-fetch: 245.32ms
478
-
479
- // Export session logs
480
- const sessionLogs = await logger.exportLogs('json', {
481
- filter: { from: sessionStart },
482
- limit: 1000
483
- })
189
+ const logger = new ExportLogger();
190
+ const csvData = await logger.exportLogs('csv', {
191
+ filter: { level: 'error' },
192
+ limit: 100
193
+ });
484
194
  ```
485
195
 
486
- ### Debugging & Development
487
- ```typescript
488
- import { Logger } from '@mks2508/better-logger'
489
-
490
- const debugLogger = new Logger({
491
- verbosity: 'debug',
492
- enableStackTrace: true,
493
- theme: 'cyberpunk'
494
- })
196
+ ## 🌐 Compatibility
495
197
 
496
- // Rich debugging information
497
- debugLogger.group('🔍 Bug Investigation')
498
- debugLogger.debug('Component state', componentState)
499
- debugLogger.warn('Performance degradation detected')
500
- debugLogger.trace('Call stack analysis')
198
+ - ✅ **All Modern Browsers** - Full feature support
199
+ - ✅ **Node.js** - Core features with graceful fallbacks
200
+ - ✅ **TypeScript** - Complete type definitions
201
+ - ✅ **ESM & CommonJS** - Both module systems supported
501
202
 
502
- // Interactive CLI debugging
503
- debugLogger.cli('/status') // Check logger configuration
504
- debugLogger.cli('/export csv --level error --limit 50')
203
+ ## 🔗 Resources
505
204
 
506
- debugLogger.groupEnd()
507
- ```
205
+ - 📦 **[NPM Package](https://www.npmjs.com/package/@mks2508/better-logger)**
206
+ - 🎮 **[Interactive Demo](https://mks2508.github.io/advanced-logger/)**
207
+ - 📚 **[Documentation](docs/)**
208
+ - 🧩 **[Examples](examples/)**
209
+ - 🐛 **[Issues & Support](https://github.com/MKS2508/advanced-logger/issues)**
508
210
 
509
211
  ## 🤝 Contributing
510
212
 
511
- Contributions are welcome! This project follows semantic versioning and uses conventional commits.
512
-
513
- ```bash
514
- # Fork and clone
515
- git clone https://github.com/yourusername/advanced-logger.git
516
-
517
- # Create feature branch
518
- git checkout -b feature/amazing-feature
519
-
520
- # Install dependencies
521
- npm install
522
-
523
- # Make changes and test
524
- npm run dev
525
-
526
- # Commit with conventional format
527
- git commit -m "feat: add amazing new feature"
528
-
529
- # Push and create PR
530
- git push origin feature/amazing-feature
531
- ```
532
-
533
- ### Development Scripts
534
- ```bash
535
- npm run dev # Development server with HMR
536
- npm run build # Production build
537
- npm run test # Run test suite
538
- npm run lint # ESLint + Prettier
539
- npm run type-check # TypeScript validation
540
- ```
541
-
542
- ## 📈 Roadmap
543
-
544
- - [x] Core logging functionality with CSS styling
545
- - [x] Advanced visual features (SVG, animations, themes)
546
- - [x] Export capabilities (CSV, JSON, XML)
547
- - [x] CLI interface with interactive commands
548
- - [x] Modular architecture with tree-shaking
549
- - [x] TypeScript declarations and documentation
550
- - [ ] React/Vue.js framework integrations
551
- - [ ] WebSocket real-time log streaming
552
- - [ ] Browser DevTools extension
553
- - [ ] Performance monitoring dashboard
554
- - [ ] Log aggregation service
555
- - [ ] Mobile-optimized interface
213
+ Contributions welcome! See our [Contributing Guide](CONTRIBUTING.md) for details.
556
214
 
557
215
  ## 📄 License
558
216
 
559
- MIT License - see [LICENSE](LICENSE) file for details.
560
-
561
- ## 🙏 Acknowledgments
562
-
563
- - **Modern Browser APIs** for advanced console styling capabilities
564
- - **Vite** for lightning-fast build system and development experience
565
- - **TypeScript** for robust type safety and developer experience
566
- - **Terser** for production-ready minification and optimization
217
+ MIT License - see [LICENSE](LICENSE) for details.
567
218
 
568
219
  ---
569
220
 
570
- <div align="center">
571
- <b>Better Logger</b> • Elevate your logging experience to the next level
572
- <br><br>
573
- <a href="https://github.com/MKS2508/advanced-logger/wiki">📚 Documentation</a> •
574
- <a href="https://github.com/MKS2508/advanced-logger/examples">🧩 Examples</a> •
575
- <a href="https://github.com/MKS2508/advanced-logger/issues">🐛 Report Bug</a> •
576
- <a href="https://github.com/MKS2508/advanced-logger/issues">✨ Request Feature</a>
577
- </div>
221
+ **Made with ❤️ by [MKS2508](https://github.com/MKS2508)**