@mks2508/better-logger 0.0.2-alpha.2 → 0.8.1-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 (231) hide show
  1. package/.github/workflows/ci-quality.yml +356 -0
  2. package/.github/workflows/docs-demo.yml +123 -0
  3. package/.github/workflows/releases-core.yml +448 -0
  4. package/.github/workflows/releases-full.yml +404 -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/CHANGELOG.json +658 -0
  10. package/README.md +110 -512
  11. package/demo.html +9 -2
  12. package/dist/Logger.d.ts +176 -0
  13. package/dist/Logger.d.ts.map +1 -0
  14. package/dist/Logger.js +498 -0
  15. package/dist/chunks/{Logger-BrFKFZcD.js → Logger-CbCUS5pQ.js} +987 -5
  16. package/dist/chunks/Logger-CbCUS5pQ.js.map +1 -0
  17. package/dist/chunks/Logger-PCfgYKTP.js +2 -0
  18. package/dist/chunks/Logger-PCfgYKTP.js.map +1 -0
  19. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
  20. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
  21. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
  22. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
  23. package/dist/chunks/StyleBuilder-BoJTmskd.js +361 -0
  24. package/dist/chunks/StyleBuilder-BoJTmskd.js.map +1 -0
  25. package/dist/chunks/StyleBuilder-LPLzsoHY.js +4 -0
  26. package/dist/chunks/StyleBuilder-LPLzsoHY.js.map +1 -0
  27. package/dist/cli/CommandProcessor.d.ts +40 -0
  28. package/dist/cli/CommandProcessor.d.ts.map +1 -0
  29. package/dist/cli/CommandProcessor.js +57 -0
  30. package/dist/cli/commands/ConfigCommand.d.ts +17 -0
  31. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
  32. package/dist/cli/commands/ConfigCommand.js +88 -0
  33. package/dist/cli/commands/ExportCommand.d.ts +51 -0
  34. package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
  35. package/dist/cli/commands/ExportCommand.js +243 -0
  36. package/dist/cli/commands/StatusCommand.d.ts +33 -0
  37. package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
  38. package/dist/cli/commands/StatusCommand.js +93 -0
  39. package/dist/cli/commands/ThemeCommand.d.ts +33 -0
  40. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
  41. package/dist/cli/commands/ThemeCommand.js +79 -0
  42. package/dist/cli/help.d.ts +15 -0
  43. package/dist/cli/help.d.ts.map +1 -0
  44. package/dist/cli/help.js +118 -0
  45. package/dist/cli/index.d.ts +15 -0
  46. package/dist/cli/index.d.ts.map +1 -0
  47. package/dist/cli/index.js +40 -0
  48. package/dist/constants.d.ts +91 -0
  49. package/dist/constants.d.ts.map +1 -0
  50. package/dist/constants.js +80 -0
  51. package/dist/core.cjs +1 -1
  52. package/dist/core.cjs.map +1 -1
  53. package/dist/core.d.ts +130 -0
  54. package/dist/core.d.ts.map +1 -0
  55. package/dist/core.js +258 -242
  56. package/dist/core.js.map +1 -1
  57. package/dist/example.d.ts +18 -0
  58. package/dist/example.d.ts.map +1 -0
  59. package/dist/example.js +154 -0
  60. package/dist/exports-module.d.ts +203 -0
  61. package/dist/exports-module.d.ts.map +1 -0
  62. package/dist/exports-module.js +260 -0
  63. package/dist/exports.cjs +1 -1
  64. package/dist/exports.cjs.map +1 -1
  65. package/dist/exports.js +2 -2
  66. package/dist/handlers/AnalyticsLogHandler.d.ts +11 -0
  67. package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  68. package/dist/handlers/AnalyticsLogHandler.js +19 -0
  69. package/dist/handlers/ExportLogHandler.d.ts +103 -0
  70. package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
  71. package/dist/handlers/ExportLogHandler.js +516 -0
  72. package/dist/handlers/FileLogHandler.d.ts +13 -0
  73. package/dist/handlers/FileLogHandler.d.ts.map +1 -0
  74. package/dist/handlers/FileLogHandler.js +24 -0
  75. package/dist/handlers/RemoteLogHandler.d.ts +14 -0
  76. package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
  77. package/dist/handlers/RemoteLogHandler.js +37 -0
  78. package/dist/handlers/index.d.ts +8 -0
  79. package/dist/handlers/index.d.ts.map +1 -0
  80. package/dist/handlers/index.js +7 -0
  81. package/dist/index.cjs +1 -1
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.d.ts +86 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +89 -103
  86. package/dist/main.d.ts +2 -0
  87. package/dist/main.d.ts.map +1 -0
  88. package/dist/main.js +139 -0
  89. package/dist/styling/StyleBuilder.d.ts +132 -0
  90. package/dist/styling/StyleBuilder.d.ts.map +1 -0
  91. package/dist/styling/StyleBuilder.js +268 -0
  92. package/dist/styling/banners.d.ts +45 -0
  93. package/dist/styling/banners.d.ts.map +1 -0
  94. package/dist/styling/banners.js +155 -0
  95. package/dist/styling/index.d.ts +7 -0
  96. package/dist/styling/index.d.ts.map +1 -0
  97. package/dist/styling/index.js +6 -0
  98. package/dist/styling/themes.d.ts +10 -0
  99. package/dist/styling/themes.d.ts.map +1 -0
  100. package/dist/styling/themes.js +231 -0
  101. package/dist/styling-module.d.ts +185 -0
  102. package/dist/styling-module.d.ts.map +1 -0
  103. package/dist/styling-module.js +199 -0
  104. package/dist/styling.cjs +1 -1
  105. package/dist/styling.cjs.map +1 -1
  106. package/dist/styling.js +4 -4
  107. package/dist/types/Logger.d.ts +172 -0
  108. package/dist/types/Logger.d.ts.map +1 -0
  109. package/dist/types/cli/CommandProcessor.d.ts +37 -0
  110. package/dist/types/cli/CommandProcessor.d.ts.map +1 -0
  111. package/dist/types/cli/commands/ConfigCommand.d.ts +14 -0
  112. package/dist/types/cli/commands/ConfigCommand.d.ts.map +1 -0
  113. package/dist/types/cli/commands/ExportCommand.d.ts +48 -0
  114. package/dist/types/cli/commands/ExportCommand.d.ts.map +1 -0
  115. package/dist/types/cli/commands/StatusCommand.d.ts +30 -0
  116. package/dist/types/cli/commands/StatusCommand.d.ts.map +1 -0
  117. package/dist/types/cli/commands/ThemeCommand.d.ts +30 -0
  118. package/dist/types/cli/commands/ThemeCommand.d.ts.map +1 -0
  119. package/dist/types/cli/help.d.ts +12 -0
  120. package/dist/types/cli/help.d.ts.map +1 -0
  121. package/dist/types/cli/index.d.ts +15 -0
  122. package/dist/types/cli/index.d.ts.map +1 -0
  123. package/dist/types/constants.d.ts +88 -0
  124. package/dist/types/constants.d.ts.map +1 -0
  125. package/dist/types/core.d.ts +71 -211
  126. package/dist/types/core.d.ts.map +1 -0
  127. package/dist/types/core.js +13 -0
  128. package/dist/types/example.d.ts +18 -0
  129. package/dist/types/example.d.ts.map +1 -0
  130. package/dist/types/exports-module.d.ts +196 -0
  131. package/dist/types/exports-module.d.ts.map +1 -0
  132. package/dist/types/handlers/AnalyticsLogHandler.d.ts +8 -0
  133. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  134. package/dist/types/handlers/ExportLogHandler.d.ts +100 -0
  135. package/dist/types/handlers/ExportLogHandler.d.ts.map +1 -0
  136. package/dist/types/handlers/FileLogHandler.d.ts +10 -0
  137. package/dist/types/handlers/FileLogHandler.d.ts.map +1 -0
  138. package/dist/types/handlers/RemoteLogHandler.d.ts +11 -0
  139. package/dist/types/handlers/RemoteLogHandler.d.ts.map +1 -0
  140. package/dist/types/handlers/index.d.ts +8 -0
  141. package/dist/types/handlers/index.d.ts.map +1 -0
  142. package/dist/types/handlers.d.ts +88 -0
  143. package/dist/types/handlers.d.ts.map +1 -0
  144. package/dist/types/handlers.js +4 -0
  145. package/dist/types/index.d.ts +7 -675
  146. package/dist/types/index.d.ts.map +1 -0
  147. package/dist/types/index.js +4 -0
  148. package/dist/types/main.d.ts +2 -0
  149. package/dist/types/main.d.ts.map +1 -0
  150. package/dist/types/styling/StyleBuilder.d.ts +132 -0
  151. package/dist/types/styling/StyleBuilder.d.ts.map +1 -0
  152. package/dist/types/styling/banners.d.ts +42 -0
  153. package/dist/types/styling/banners.d.ts.map +1 -0
  154. package/dist/types/styling/index.d.ts +7 -0
  155. package/dist/types/styling/index.d.ts.map +1 -0
  156. package/dist/types/styling/themes.d.ts +7 -0
  157. package/dist/types/styling/themes.d.ts.map +1 -0
  158. package/dist/types/styling-module.d.ts +178 -0
  159. package/dist/types/styling-module.d.ts.map +1 -0
  160. package/dist/types/types/core.d.ts +71 -0
  161. package/dist/types/types/core.d.ts.map +1 -0
  162. package/dist/types/types/handlers.d.ts +85 -0
  163. package/dist/types/types/handlers.d.ts.map +1 -0
  164. package/dist/types/types/index.d.ts +7 -0
  165. package/dist/types/types/index.d.ts.map +1 -0
  166. package/dist/types/utils/index.d.ts +7 -0
  167. package/dist/types/utils/index.d.ts.map +1 -0
  168. package/dist/types/utils/output.d.ts +29 -0
  169. package/dist/types/utils/output.d.ts.map +1 -0
  170. package/dist/types/utils/stackTrace.d.ts +6 -0
  171. package/dist/types/utils/stackTrace.d.ts.map +1 -0
  172. package/dist/types/utils/timestamps.d.ts +20 -0
  173. package/dist/types/utils/timestamps.d.ts.map +1 -0
  174. package/dist/utils/index.d.ts +7 -0
  175. package/dist/utils/index.d.ts.map +1 -0
  176. package/dist/utils/index.js +6 -0
  177. package/dist/utils/output.d.ts +32 -0
  178. package/dist/utils/output.d.ts.map +1 -0
  179. package/dist/utils/output.js +97 -0
  180. package/dist/utils/stackTrace.d.ts +9 -0
  181. package/dist/utils/stackTrace.d.ts.map +1 -0
  182. package/dist/utils/stackTrace.js +81 -0
  183. package/dist/utils/timestamps.d.ts +20 -0
  184. package/dist/utils/timestamps.d.ts.map +1 -0
  185. package/dist/utils/timestamps.js +71 -0
  186. package/docs/API.md +607 -0
  187. package/docs/DEVELOPMENT.md +731 -0
  188. package/docs/_config.yml +36 -0
  189. package/docs/index.md +179 -0
  190. package/examples/README.md +208 -0
  191. package/examples/basic-logging.js +75 -0
  192. package/examples/data-export.js +234 -0
  193. package/examples/package.json +16 -0
  194. package/examples/performance-timing.js +170 -0
  195. package/examples/styling-themes.js +207 -0
  196. package/package.json +24 -21
  197. package/packages/core/package.json +35 -0
  198. package/packages/exports/package.json +41 -0
  199. package/packages/styling/package.json +41 -0
  200. package/project-utils/README.md +172 -0
  201. package/project-utils/auto-release-gemini.ts +1193 -0
  202. package/project-utils/commit-generator.ts +1000 -0
  203. package/project-utils/commit-ui.ts +246 -0
  204. package/project-utils/git-utils.ts +199 -0
  205. package/project-utils/github-release-manager.ts +466 -0
  206. package/project-utils/prompt-templates.js +345 -0
  207. package/project-utils/prompt-templates.ts +422 -0
  208. package/project-utils/version-manager.ts +1078 -0
  209. package/src/Logger.ts +2 -1
  210. package/src/handlers/ExportLogHandler.ts +141 -0
  211. package/vite.config.ts +152 -50
  212. package/.claude/settings.local.json +0 -22
  213. package/.npmrc.bak +0 -1
  214. package/dist/chunks/Logger-BQhMKy_T.js +0 -2
  215. package/dist/chunks/Logger-BQhMKy_T.js.map +0 -1
  216. package/dist/chunks/Logger-BrFKFZcD.js.map +0 -1
  217. package/dist/chunks/core-2opW4Pi3.js +0 -194
  218. package/dist/chunks/core-2opW4Pi3.js.map +0 -1
  219. package/dist/chunks/core-DyugwSYZ.js +0 -4
  220. package/dist/chunks/core-DyugwSYZ.js.map +0 -1
  221. package/dist/chunks/exports-BNP3R7dp.js +0 -421
  222. package/dist/chunks/exports-BNP3R7dp.js.map +0 -1
  223. package/dist/chunks/exports-U1xLBXrY.js +0 -2
  224. package/dist/chunks/exports-U1xLBXrY.js.map +0 -1
  225. package/dist/chunks/styling-DhUDzwlE.js +0 -654
  226. package/dist/chunks/styling-DhUDzwlE.js.map +0 -1
  227. package/dist/chunks/styling-tmRDI28D.js +0 -2
  228. package/dist/chunks/styling-tmRDI28D.js.map +0 -1
  229. package/dist/types/exports.d.ts +0 -600
  230. package/dist/types/styling.d.ts +0 -751
  231. /package/.github/{workflows → workflows-backup}/release.yml +0 -0
package/README.md CHANGED
@@ -1,577 +1,175 @@
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
- ---
18
-
19
- ## 🌟 Features
20
-
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** |
28
-
29
- ## 🚀 Quick Start
30
-
31
- ```bash
32
- # Install the package
33
- npm install @mks2508/better-logger
3
+ **State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface**
34
4
 
35
- # Basic usage
36
- import logger from '@mks2508/better-logger'
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)
37
9
 
38
- logger.info('Hello, beautiful logs! 🎉')
39
- logger.success('Operation completed successfully')
40
- logger.error('Something went wrong', error)
41
- ```
10
+ Transform your console logging experience with beautiful styling, professional themes, and advanced features that make debugging and monitoring a visual delight.
42
11
 
43
- ### Modular Imports
12
+ ## ✨ Features
44
13
 
45
- ```typescript
46
- // Core logging only (~6KB)
47
- import { debug, info, warn, error } from '@mks2508/better-logger/core'
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
48
24
 
49
- // With advanced styling (~26KB)
50
- import { logAnimated, setTheme } from '@mks2508/better-logger/styling'
25
+ ## 📦 Installation
51
26
 
52
- // With export capabilities (~12KB)
53
- import { exportLogs } from '@mks2508/better-logger/exports'
54
- ```
55
-
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! 🌈')
27
+ ```bash
28
+ npm install @mks2508/better-logger
67
29
  ```
68
30
 
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
- ```
31
+ ## 🚀 Quick Start
80
32
 
81
- ### CSS Animations
82
33
  ```typescript
83
- import { logAnimated } from '@mks2508/better-logger'
34
+ import { Logger } from '@mks2508/better-logger';
84
35
 
85
- logAnimated('🚀 Loading with style...', 3) // 3 second animation
86
- ```
87
-
88
- ## 📦 Bundle Analysis
89
-
90
- > **Optimized for modern applications with intelligent code splitting**
36
+ const logger = new Logger({ prefix: 'APP' });
91
37
 
92
- ```
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
- ```
38
+ // Beautiful styled logging
39
+ logger.info('Application started', { version: '1.0.0' });
40
+ logger.success('Database connected successfully');
41
+ logger.warn('Memory usage high', { usage: '85%' });
42
+ logger.error('API request failed', { status: 500 });
102
43
 
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]
44
+ // Performance timing
45
+ logger.time('operation');
46
+ await performOperation();
47
+ logger.timeEnd('operation'); // Shows duration with beautiful styling
140
48
  ```
141
49
 
142
- ## 🎯 Module Guide
50
+ ## 🔧 Modular Usage
143
51
 
144
- <table>
145
- <tr>
146
- <td width="33%" valign="top">
147
-
148
- ### 📦 Core Module
149
- **Lightweight • Essential features only**
52
+ Import only what you need for optimal bundle sizes:
150
53
 
151
54
  ```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
- ```
163
-
164
- **Size: 6KB • Perfect for libraries**
165
-
166
- </td>
167
- <td width="33%" valign="top">
55
+ // Core logging only (6KB) - Essential features
56
+ import { Logger } from '@mks2508/better-logger/core';
168
57
 
169
- ### 🎨 Styling Module
170
- **Visual • Themes & animations**
58
+ // Styling features (26KB) - Themes, SVG, animations
59
+ import { setTheme, logAnimated } from '@mks2508/better-logger/styling';
171
60
 
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()
61
+ // Export capabilities (12KB) - Data export, remote logging
62
+ import { ExportLogger } from '@mks2508/better-logger/exports';
185
63
  ```
186
64
 
187
- **Size: 26KB • Rich visual experience**
65
+ ## 📊 Bundle Analysis
188
66
 
189
- </td>
190
- <td width="33%" valign="top">
67
+ | Module | Size | Gzipped | Best For |
68
+ |--------|------|---------|----------|
69
+ | **Core** | 6KB | 2KB | Essential logging, Node.js apps |
70
+ | **Styling** | 26KB | 5KB | Frontend apps, visual debugging |
71
+ | **Exports** | 12KB | 3KB | Production logging, analytics |
72
+ | **Full** | 64KB | 13KB | Complete feature set |
191
73
 
192
- ### 📤 Exports Module
193
- **Data management • Export capabilities**
74
+ ## 📚 Documentation & Learning
194
75
 
195
- ```typescript
196
- import {
197
- ExportLogger,
198
- exportLogs, addRemoteHandler
199
- } from '@mks2508/better-logger/exports'
76
+ ### 📖 Complete Documentation
77
+ - **[📋 API Reference](docs/API.md)** - Complete method documentation
78
+ - **[🚀 Core Module](docs/CORE.md)** - Essential logging features
79
+ - **[🎨 Styling Module](docs/STYLING.md)** - Themes and visual customization
80
+ - **[📤 Exports Module](docs/EXPORTS.md)** - Data export and remote logging
200
81
 
201
- const logger = new ExportLogger({
202
- bufferSize: 1000
203
- })
82
+ ### 🎮 Interactive Learning
83
+ - **[🌟 Live Demo](https://mks2508.github.io/advanced-logger/)** - Try all features in your browser
84
+ - **[📁 Examples](examples/)** - 4 comprehensive tutorials with runnable code
204
85
 
205
- const csvData = await exportLogs('csv')
206
- addRemoteHandler('https://api.logs.com')
86
+ ### 🏃 Quick Examples
87
+ ```bash
88
+ cd examples && npm install
89
+ npm run basic # Learn fundamentals
90
+ npm run performance # Master timing operations
91
+ npm run styling # Explore visual features
92
+ npm run export # Data management
207
93
  ```
208
94
 
209
- **Size: 12KB • Enterprise features**
95
+ ## 🎨 Visual Showcase
210
96
 
211
- </td>
212
- </tr>
213
- </table>
214
-
215
- ## 💻 API Reference
216
-
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
- ```
226
-
227
- ### Advanced Features
97
+ ### Professional Themes
228
98
  ```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
- ```
99
+ import { setTheme } from '@mks2508/better-logger/styling';
249
100
 
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
101
+ setTheme('cyberpunk'); // Purple/pink futuristic
102
+ setTheme('neon'); // Bright electric colors
103
+ setTheme('dark'); // Dark mode optimized
258
104
  ```
259
105
 
260
- ## 🎨 Styling API
261
-
262
- ### Custom Styles
106
+ ### Custom Styling
263
107
  ```typescript
264
- import { createStyle, stylePresets } from '@mks2508/better-logger'
108
+ import { createStyle } from '@mks2508/better-logger/styling';
265
109
 
266
- // Build custom style
267
- const myStyle = createStyle()
268
- .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
110
+ const customStyle = createStyle()
111
+ .bg('linear-gradient(45deg, #667eea, #764ba2)')
269
112
  .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)
113
+ .padding('12px 24px')
114
+ .rounded('8px')
115
+ .shadow('0 4px 15px rgba(102, 126, 234, 0.4)')
116
+ .build();
277
117
 
278
- // Use presets
279
- console.log('%cSuccess!', stylePresets.success)
280
- console.log('%cError!', stylePresets.error)
118
+ console.log('%c🚀 Beautiful Custom Style!', customStyle);
281
119
  ```
282
120
 
283
- ### Theme Configuration
284
- ```typescript
285
- // Available themes
286
- const themes = ['default', 'dark', 'neon', 'cyberpunk', 'retro']
287
-
288
- // Set theme with banner
289
- setTheme('cyberpunk') // Automatically shows themed banner
121
+ ## ⚡ Advanced Features
290
122
 
291
- // Manual banner display
292
- showBanner('animated') // simple, ascii, unicode, svg, animated
293
- ```
294
-
295
- ## 📊 Export & Remote Logging
296
-
297
- ### Export Capabilities
123
+ ### CLI Interface
298
124
  ```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
- })
125
+ import { initializeCLI } from '@mks2508/better-logger/cli';
126
+ initializeCLI(logger);
309
127
 
310
- // Get statistics
311
- const stats = logger.getLogStats()
312
- console.log(`Errors: ${stats.error}, Warnings: ${stats.warn}`)
128
+ // Available in browser console:
129
+ // /help /theme /export /clear /status
313
130
  ```
314
131
 
315
- ### Remote Logging
132
+ ### Performance Monitoring
316
133
  ```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()
134
+ logger.time('api-request');
135
+ const result = await fetch('/api/data');
136
+ logger.timeEnd('api-request'); // Automatic duration display
326
137
  ```
327
138
 
328
- ## 🔧 Configuration
329
-
330
- ### Logger Configuration
139
+ ### Data Export
331
140
  ```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
- ```
345
-
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
- ```
141
+ import { ExportLogger } from '@mks2508/better-logger/exports';
415
142
 
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
- })
143
+ const logger = new ExportLogger();
144
+ const csvData = await logger.exportLogs('csv', {
145
+ filter: { level: 'error' },
146
+ limit: 100
147
+ });
484
148
  ```
485
149
 
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
- })
150
+ ## 🌐 Compatibility
495
151
 
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')
152
+ - ✅ **All Modern Browsers** - Full feature support
153
+ - ✅ **Node.js** - Core features with graceful fallbacks
154
+ - ✅ **TypeScript** - Complete type definitions
155
+ - ✅ **ESM & CommonJS** - Both module systems supported
501
156
 
502
- // Interactive CLI debugging
503
- debugLogger.cli('/status') // Check logger configuration
504
- debugLogger.cli('/export csv --level error --limit 50')
157
+ ## 🔗 Resources
505
158
 
506
- debugLogger.groupEnd()
507
- ```
159
+ - 📦 **[NPM Package](https://www.npmjs.com/package/@mks2508/better-logger)**
160
+ - 🎮 **[Interactive Demo](https://mks2508.github.io/advanced-logger/)**
161
+ - 📚 **[Documentation](docs/)**
162
+ - 🧩 **[Examples](examples/)**
163
+ - 🐛 **[Issues & Support](https://github.com/MKS2508/advanced-logger/issues)**
508
164
 
509
165
  ## 🤝 Contributing
510
166
 
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
167
+ Contributions welcome! See our [Contributing Guide](CONTRIBUTING.md) for details.
556
168
 
557
169
  ## 📄 License
558
170
 
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
171
+ MIT License - see [LICENSE](LICENSE) for details.
567
172
 
568
173
  ---
569
174
 
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>
175
+ **Made with ❤️ by [MKS2508](https://github.com/MKS2508)**