@mks2508/better-logger 0.0.2-alpha.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/.claude/settings.local.json +18 -2
  2. package/.github/workflows/ci-quality.yml +357 -0
  3. package/.github/workflows/docs-demo.yml +119 -0
  4. package/.github/workflows/releases-core.yml +512 -0
  5. package/.github/workflows/releases-full.yml +582 -0
  6. package/.github/{workflows → workflows-backup}/ci.yml +12 -110
  7. package/.github/workflows-backup/nightly.yml +196 -0
  8. package/.github/workflows-backup/release-optimized.yml +373 -0
  9. package/.release-notes-0.2.0.md +129 -0
  10. package/.yamllint +28 -0
  11. package/CHANGELOG.json +783 -0
  12. package/CLAUDE.md +92 -1
  13. package/README.md +198 -490
  14. package/bun.lock +323 -0
  15. package/demo.html +9 -2
  16. package/dist/.tsbuildinfo +1 -0
  17. package/dist/Logger.d.ts +272 -0
  18. package/dist/Logger.d.ts.map +1 -0
  19. package/dist/Logger.js +680 -0
  20. package/dist/ScopedLogger.d.ts +126 -0
  21. package/dist/ScopedLogger.d.ts.map +1 -0
  22. package/dist/ScopedLogger.js +234 -0
  23. package/dist/chunks/Logger-BpeuYIxR.js +2 -0
  24. package/dist/chunks/Logger-BpeuYIxR.js.map +1 -0
  25. package/dist/chunks/Logger-Didxtr23.js +3275 -0
  26. package/dist/chunks/Logger-Didxtr23.js.map +1 -0
  27. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
  28. package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
  29. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
  30. package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
  31. package/dist/chunks/environment-Bxbnw4pd.js +544 -0
  32. package/dist/chunks/environment-Bxbnw4pd.js.map +1 -0
  33. package/dist/chunks/environment-Dm66zOML.js +4 -0
  34. package/dist/chunks/environment-Dm66zOML.js.map +1 -0
  35. package/dist/chunks/formatting-C0riPC5_.js +95 -0
  36. package/dist/chunks/formatting-C0riPC5_.js.map +1 -0
  37. package/dist/chunks/formatting-DNCAV66-.js +2 -0
  38. package/dist/chunks/formatting-DNCAV66-.js.map +1 -0
  39. package/dist/cli/CommandProcessor.d.ts +103 -0
  40. package/dist/cli/CommandProcessor.d.ts.map +1 -0
  41. package/dist/cli/CommandProcessor.js +184 -0
  42. package/dist/cli/commands/ConfigCommand.d.ts +17 -0
  43. package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
  44. package/dist/cli/commands/ConfigCommand.js +88 -0
  45. package/dist/cli/commands/ExportCommand.d.ts +51 -0
  46. package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
  47. package/dist/cli/commands/ExportCommand.js +243 -0
  48. package/dist/cli/commands/HistoryCommand.d.ts +50 -0
  49. package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
  50. package/dist/cli/commands/HistoryCommand.js +96 -0
  51. package/dist/cli/commands/StatusCommand.d.ts +33 -0
  52. package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
  53. package/dist/cli/commands/StatusCommand.js +93 -0
  54. package/dist/cli/commands/ThemeCommand.d.ts +33 -0
  55. package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
  56. package/dist/cli/commands/ThemeCommand.js +79 -0
  57. package/dist/cli/help.d.ts +15 -0
  58. package/dist/cli/help.d.ts.map +1 -0
  59. package/dist/cli/help.js +118 -0
  60. package/dist/cli/index.d.ts +15 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +46 -0
  63. package/dist/constants.d.ts +122 -0
  64. package/dist/constants.d.ts.map +1 -0
  65. package/dist/constants.js +159 -0
  66. package/dist/core.cjs +1 -1
  67. package/dist/core.cjs.map +1 -1
  68. package/dist/core.d.ts +134 -0
  69. package/dist/core.d.ts.map +1 -0
  70. package/dist/core.js +315 -242
  71. package/dist/core.js.map +1 -1
  72. package/dist/example.d.ts +18 -0
  73. package/dist/example.d.ts.map +1 -0
  74. package/dist/example.js +154 -0
  75. package/dist/exports-module.d.ts +203 -0
  76. package/dist/exports-module.d.ts.map +1 -0
  77. package/dist/exports-module.js +260 -0
  78. package/dist/exports.cjs +1 -1
  79. package/dist/exports.cjs.map +1 -1
  80. package/dist/exports.js +5 -4
  81. package/dist/exports.js.map +1 -1
  82. package/dist/handlers/AnalyticsLogHandler.d.ts +11 -0
  83. package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  84. package/dist/handlers/AnalyticsLogHandler.js +19 -0
  85. package/dist/handlers/ExportLogHandler.d.ts +103 -0
  86. package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
  87. package/dist/handlers/ExportLogHandler.js +516 -0
  88. package/dist/handlers/FileLogHandler.d.ts +36 -0
  89. package/dist/handlers/FileLogHandler.d.ts.map +1 -0
  90. package/dist/handlers/FileLogHandler.js +156 -0
  91. package/dist/handlers/RemoteLogHandler.d.ts +14 -0
  92. package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
  93. package/dist/handlers/RemoteLogHandler.js +37 -0
  94. package/dist/handlers/index.d.ts +8 -0
  95. package/dist/handlers/index.d.ts.map +1 -0
  96. package/dist/handlers/index.js +7 -0
  97. package/dist/index.cjs +1 -1
  98. package/dist/index.cjs.map +1 -1
  99. package/dist/index.d.ts +86 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +89 -103
  102. package/dist/index.js.map +1 -1
  103. package/dist/main.d.ts +2 -0
  104. package/dist/main.d.ts.map +1 -0
  105. package/dist/main.js +139 -0
  106. package/dist/styling/LogStyleBuilder.d.ts +149 -0
  107. package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
  108. package/dist/styling/LogStyleBuilder.js +289 -0
  109. package/dist/styling/SemanticStyles.d.ts +181 -0
  110. package/dist/styling/SemanticStyles.d.ts.map +1 -0
  111. package/dist/styling/SemanticStyles.js +339 -0
  112. package/dist/styling/SmartPresets.d.ts +25 -0
  113. package/dist/styling/SmartPresets.d.ts.map +1 -0
  114. package/dist/styling/SmartPresets.js +276 -0
  115. package/dist/styling/StyleBuilder.d.ts +140 -0
  116. package/dist/styling/StyleBuilder.d.ts.map +1 -0
  117. package/dist/styling/StyleBuilder.js +280 -0
  118. package/dist/styling/banners.d.ts +45 -0
  119. package/dist/styling/banners.d.ts.map +1 -0
  120. package/dist/styling/banners.js +155 -0
  121. package/dist/styling/index.d.ts +10 -0
  122. package/dist/styling/index.d.ts.map +1 -0
  123. package/dist/styling/index.js +9 -0
  124. package/dist/styling/themes.d.ts +10 -0
  125. package/dist/styling/themes.d.ts.map +1 -0
  126. package/dist/styling/themes.js +231 -0
  127. package/dist/styling-module.d.ts +185 -0
  128. package/dist/styling-module.d.ts.map +1 -0
  129. package/dist/styling-module.js +199 -0
  130. package/dist/styling.cjs +1 -1
  131. package/dist/styling.cjs.map +1 -1
  132. package/dist/styling.js +6 -6
  133. package/dist/styling.js.map +1 -1
  134. package/dist/types/Logger.d.ts +268 -0
  135. package/dist/types/Logger.d.ts.map +1 -0
  136. package/dist/types/ScopedLogger.d.ts +123 -0
  137. package/dist/types/ScopedLogger.d.ts.map +1 -0
  138. package/dist/types/cli/CommandProcessor.d.ts +100 -0
  139. package/dist/types/cli/CommandProcessor.d.ts.map +1 -0
  140. package/dist/types/cli/commands/ConfigCommand.d.ts +14 -0
  141. package/dist/types/cli/commands/ConfigCommand.d.ts.map +1 -0
  142. package/dist/types/cli/commands/ExportCommand.d.ts +48 -0
  143. package/dist/types/cli/commands/ExportCommand.d.ts.map +1 -0
  144. package/dist/types/cli/commands/HistoryCommand.d.ts +47 -0
  145. package/dist/types/cli/commands/HistoryCommand.d.ts.map +1 -0
  146. package/dist/types/cli/commands/StatusCommand.d.ts +30 -0
  147. package/dist/types/cli/commands/StatusCommand.d.ts.map +1 -0
  148. package/dist/types/cli/commands/ThemeCommand.d.ts +30 -0
  149. package/dist/types/cli/commands/ThemeCommand.d.ts.map +1 -0
  150. package/dist/types/cli/help.d.ts +12 -0
  151. package/dist/types/cli/help.d.ts.map +1 -0
  152. package/dist/types/cli/index.d.ts +15 -0
  153. package/dist/types/cli/index.d.ts.map +1 -0
  154. package/dist/types/constants.d.ts +119 -0
  155. package/dist/types/constants.d.ts.map +1 -0
  156. package/dist/types/core.d.ts +125 -211
  157. package/dist/types/core.d.ts.map +1 -0
  158. package/dist/types/core.js +13 -0
  159. package/dist/types/example.d.ts +18 -0
  160. package/dist/types/example.d.ts.map +1 -0
  161. package/dist/types/exports-module.d.ts +196 -0
  162. package/dist/types/exports-module.d.ts.map +1 -0
  163. package/dist/types/handlers/AnalyticsLogHandler.d.ts +8 -0
  164. package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +1 -0
  165. package/dist/types/handlers/ExportLogHandler.d.ts +100 -0
  166. package/dist/types/handlers/ExportLogHandler.d.ts.map +1 -0
  167. package/dist/types/handlers/FileLogHandler.d.ts +33 -0
  168. package/dist/types/handlers/FileLogHandler.d.ts.map +1 -0
  169. package/dist/types/handlers/RemoteLogHandler.d.ts +11 -0
  170. package/dist/types/handlers/RemoteLogHandler.d.ts.map +1 -0
  171. package/dist/types/handlers/index.d.ts +8 -0
  172. package/dist/types/handlers/index.d.ts.map +1 -0
  173. package/dist/types/handlers.d.ts +88 -0
  174. package/dist/types/handlers.d.ts.map +1 -0
  175. package/dist/types/handlers.js +4 -0
  176. package/dist/types/index.d.ts +7 -675
  177. package/dist/types/index.d.ts.map +1 -0
  178. package/dist/types/index.js +4 -0
  179. package/dist/types/main.d.ts +2 -0
  180. package/dist/types/main.d.ts.map +1 -0
  181. package/dist/types/styling/LogStyleBuilder.d.ts +146 -0
  182. package/dist/types/styling/LogStyleBuilder.d.ts.map +1 -0
  183. package/dist/types/styling/SemanticStyles.d.ts +178 -0
  184. package/dist/types/styling/SemanticStyles.d.ts.map +1 -0
  185. package/dist/types/styling/SmartPresets.d.ts +22 -0
  186. package/dist/types/styling/SmartPresets.d.ts.map +1 -0
  187. package/dist/types/styling/StyleBuilder.d.ts +140 -0
  188. package/dist/types/styling/StyleBuilder.d.ts.map +1 -0
  189. package/dist/types/styling/banners.d.ts +42 -0
  190. package/dist/types/styling/banners.d.ts.map +1 -0
  191. package/dist/types/styling/index.d.ts +10 -0
  192. package/dist/types/styling/index.d.ts.map +1 -0
  193. package/dist/types/styling/themes.d.ts +7 -0
  194. package/dist/types/styling/themes.d.ts.map +1 -0
  195. package/dist/types/styling-module.d.ts +178 -0
  196. package/dist/types/styling-module.d.ts.map +1 -0
  197. package/dist/types/types/core.d.ts +125 -0
  198. package/dist/types/types/core.d.ts.map +1 -0
  199. package/dist/types/types/handlers.d.ts +85 -0
  200. package/dist/types/types/handlers.d.ts.map +1 -0
  201. package/dist/types/types/index.d.ts +7 -0
  202. package/dist/types/types/index.d.ts.map +1 -0
  203. package/dist/types/utils/environment.d.ts +47 -0
  204. package/dist/types/utils/environment.d.ts.map +1 -0
  205. package/dist/types/utils/formatting.d.ts +37 -0
  206. package/dist/types/utils/formatting.d.ts.map +1 -0
  207. package/dist/types/utils/index.d.ts +7 -0
  208. package/dist/types/utils/index.d.ts.map +1 -0
  209. package/dist/types/utils/opentui-detection.d.ts +34 -0
  210. package/dist/types/utils/opentui-detection.d.ts.map +1 -0
  211. package/dist/types/utils/output.d.ts +41 -0
  212. package/dist/types/utils/output.d.ts.map +1 -0
  213. package/dist/types/utils/stackTrace.d.ts +6 -0
  214. package/dist/types/utils/stackTrace.d.ts.map +1 -0
  215. package/dist/types/utils/timestamps.d.ts +20 -0
  216. package/dist/types/utils/timestamps.d.ts.map +1 -0
  217. package/dist/utils/environment.d.ts +47 -0
  218. package/dist/utils/environment.d.ts.map +1 -0
  219. package/dist/utils/environment.js +85 -0
  220. package/dist/utils/formatting.d.ts +40 -0
  221. package/dist/utils/formatting.d.ts.map +1 -0
  222. package/dist/utils/formatting.js +117 -0
  223. package/dist/utils/index.d.ts +7 -0
  224. package/dist/utils/index.d.ts.map +1 -0
  225. package/dist/utils/index.js +6 -0
  226. package/dist/utils/opentui-detection.d.ts +34 -0
  227. package/dist/utils/opentui-detection.d.ts.map +1 -0
  228. package/dist/utils/opentui-detection.js +116 -0
  229. package/dist/utils/output.d.ts +44 -0
  230. package/dist/utils/output.d.ts.map +1 -0
  231. package/dist/utils/output.js +150 -0
  232. package/dist/utils/stackTrace.d.ts +9 -0
  233. package/dist/utils/stackTrace.d.ts.map +1 -0
  234. package/dist/utils/stackTrace.js +81 -0
  235. package/dist/utils/timestamps.d.ts +20 -0
  236. package/dist/utils/timestamps.d.ts.map +1 -0
  237. package/dist/utils/timestamps.js +71 -0
  238. package/docs/API.md +691 -0
  239. package/docs/CORE.md +10 -10
  240. package/docs/DEVELOPMENT.md +731 -0
  241. package/docs/PACKAGES.md +244 -0
  242. package/docs/_config.yml +36 -0
  243. package/docs/index.md +179 -0
  244. package/examples/README.md +208 -0
  245. package/examples/basic-logging.js +75 -0
  246. package/examples/data-export.js +234 -0
  247. package/examples/package.json +16 -0
  248. package/examples/performance-timing.js +170 -0
  249. package/examples/simplified-api.js +124 -0
  250. package/examples/styling-themes.js +207 -0
  251. package/package.json +37 -21
  252. package/packages/core/package.json +57 -0
  253. package/packages/exports/package.json +41 -0
  254. package/packages/nodejs-opentui/README.md +232 -0
  255. package/packages/nodejs-opentui/package.json +72 -0
  256. package/packages/nodejs-opentui/src/LogRenderer.ts +171 -0
  257. package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +178 -0
  258. package/packages/nodejs-opentui/src/components/LogBadge.tsx +131 -0
  259. package/packages/nodejs-opentui/src/index.ts +133 -0
  260. package/packages/nodejs-opentui/src/types.ts +158 -0
  261. package/packages/nodejs-opentui/tsconfig.json +20 -0
  262. package/packages/styling/package.json +41 -0
  263. package/project-utils/README.md +172 -0
  264. package/project-utils/auto-release-gemini.ts +1193 -0
  265. package/project-utils/auto-release-ui.ts +1329 -0
  266. package/project-utils/commit-generator.ts +1385 -0
  267. package/project-utils/commit-ui.ts +264 -0
  268. package/project-utils/git-utils.ts +199 -0
  269. package/project-utils/github-release-manager.ts +466 -0
  270. package/project-utils/project-config.ts +260 -0
  271. package/project-utils/prompt-templates.js +345 -0
  272. package/project-utils/prompt-templates.ts +422 -0
  273. package/project-utils/version-manager.ts +1078 -0
  274. package/src/Logger.ts +251 -16
  275. package/src/ScopedLogger.ts +262 -0
  276. package/src/cli/CommandProcessor.ts +173 -2
  277. package/src/cli/commands/HistoryCommand.ts +117 -0
  278. package/src/cli/index.ts +12 -0
  279. package/src/constants.ts +84 -2
  280. package/src/core.ts +119 -46
  281. package/src/example.ts +4 -4
  282. package/src/exports-module.ts +1 -1
  283. package/src/handlers/ExportLogHandler.ts +141 -0
  284. package/src/handlers/FileLogHandler.ts +144 -5
  285. package/src/index.ts +1 -1
  286. package/src/main.ts +3 -3
  287. package/src/styling/LogStyleBuilder.ts +355 -0
  288. package/src/styling/SemanticStyles.ts +380 -0
  289. package/src/styling/SmartPresets.ts +288 -0
  290. package/src/styling/StyleBuilder.ts +14 -0
  291. package/src/styling/index.ts +16 -1
  292. package/src/styling-module.ts +1 -1
  293. package/src/types/core.ts +60 -0
  294. package/src/types/index.ts +6 -0
  295. package/src/utils/environment.ts +94 -0
  296. package/src/utils/formatting.ts +142 -0
  297. package/src/utils/index.ts +3 -0
  298. package/src/utils/opentui-detection.ts +138 -0
  299. package/src/utils/output.ts +66 -8
  300. package/test-core-browser.html +237 -0
  301. package/test-core-node.js +63 -0
  302. package/tests/test-conflict-resolution.ts +391 -0
  303. package/tests/validate-workflows.sh +131 -0
  304. package/tests/yaml-autofix.sh +146 -0
  305. package/vite.config.ts +189 -50
  306. package/.npmrc.bak +0 -1
  307. package/dist/chunks/Logger-BQhMKy_T.js +0 -2
  308. package/dist/chunks/Logger-BQhMKy_T.js.map +0 -1
  309. package/dist/chunks/Logger-BrFKFZcD.js +0 -978
  310. package/dist/chunks/Logger-BrFKFZcD.js.map +0 -1
  311. package/dist/chunks/core-2opW4Pi3.js +0 -194
  312. package/dist/chunks/core-2opW4Pi3.js.map +0 -1
  313. package/dist/chunks/core-DyugwSYZ.js +0 -4
  314. package/dist/chunks/core-DyugwSYZ.js.map +0 -1
  315. package/dist/chunks/exports-BNP3R7dp.js +0 -421
  316. package/dist/chunks/exports-BNP3R7dp.js.map +0 -1
  317. package/dist/chunks/exports-U1xLBXrY.js +0 -2
  318. package/dist/chunks/exports-U1xLBXrY.js.map +0 -1
  319. package/dist/chunks/styling-DhUDzwlE.js +0 -654
  320. package/dist/chunks/styling-DhUDzwlE.js.map +0 -1
  321. package/dist/chunks/styling-tmRDI28D.js +0 -2
  322. package/dist/chunks/styling-tmRDI28D.js.map +0 -1
  323. package/dist/types/exports.d.ts +0 -600
  324. package/dist/types/styling.d.ts +0 -751
  325. package/src/Logger.ts.backup +0 -1684
  326. /package/.github/{workflows → workflows-backup}/release.yml +0 -0
@@ -0,0 +1,244 @@
1
+ ---
2
+ layout: default
3
+ title: Sub-Packages Guide
4
+ permalink: /packages/
5
+ ---
6
+
7
+ # 📦 Sub-Packages Guide
8
+
9
+ Better Logger provides modular architecture with independent packages for specific functionality.
10
+
11
+ ## Package Overview
12
+
13
+ | Package | Description | Size | Dependencies |
14
+ |---------|-------------|------|--------------|
15
+ | `@mks2508/better-logger` | **Main package** - Full functionality | ~45KB | None |
16
+ | `@mks2508/better-logger-core` | **Core logging** - Essential features only | ~15KB | None |
17
+ | `@mks2508/better-logger-styling` | **Styling system** - CSS themes & visuals | ~12KB | core |
18
+ | `@mks2508/better-logger-exports` | **Export handlers** - File, remote, analytics | ~18KB | core |
19
+
20
+ ---
21
+
22
+ ## 🚀 Installation Options
23
+
24
+ ### Full Package (Recommended)
25
+ ```bash
26
+ npm install @mks2508/better-logger
27
+ ```
28
+
29
+ ### Modular Installation
30
+ ```bash
31
+ # Core functionality only
32
+ npm install @mks2508/better-logger-core
33
+
34
+ # Add styling capabilities
35
+ npm install @mks2508/better-logger-styling
36
+
37
+ # Add export functionality
38
+ npm install @mks2508/better-logger-exports
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 📋 Package Details
44
+
45
+ ### Core Package (`@mks2508/better-logger-core`)
46
+
47
+ **What it includes:**
48
+ - ✅ Basic logging methods (debug, info, warn, error, critical)
49
+ - ✅ Log level filtering and verbosity
50
+ - ✅ Performance timing (time/timeEnd)
51
+ - ✅ Stack trace capture
52
+ - ✅ Scoped loggers with prefixes
53
+ - ✅ Basic console grouping
54
+
55
+ **What it excludes:**
56
+ - ❌ Advanced CSS styling and themes
57
+ - ❌ Export handlers (file, remote, analytics)
58
+ - ❌ CLI interface
59
+ - ❌ SVG banners and animations
60
+
61
+ ```typescript
62
+ // Core-only usage
63
+ import { Logger } from '@mks2508/better-logger-core';
64
+
65
+ const logger = new Logger();
66
+ logger.info('Basic logging works!');
67
+ logger.time('operation');
68
+ // ... do work
69
+ logger.timeEnd('operation');
70
+ ```
71
+
72
+ ### Styling Package (`@mks2508/better-logger-styling`)
73
+
74
+ **What it adds:**
75
+ - ✅ Advanced CSS gradients and themes
76
+ - ✅ Pre-built theme variants (matrix, cyberpunk, etc.)
77
+ - ✅ Custom style builder with fluent API
78
+ - ✅ SVG banner support
79
+ - ✅ Animation effects for console output
80
+
81
+ ```typescript
82
+ // With styling capabilities
83
+ import { Logger } from '@mks2508/better-logger-core';
84
+ import { applyTheme, StyleBuilder } from '@mks2508/better-logger-styling';
85
+
86
+ const logger = new Logger();
87
+ applyTheme(logger, 'matrix');
88
+
89
+ // Custom styling
90
+ const style = new StyleBuilder()
91
+ .backgroundColor('#1a1a2e')
92
+ .color('#eee')
93
+ .fontSize('14px')
94
+ .build();
95
+
96
+ logger.info('Styled message', { style });
97
+ ```
98
+
99
+ ### Exports Package (`@mks2508/better-logger-exports`)
100
+
101
+ **What it adds:**
102
+ - ✅ File export handlers (CSV, JSON, XML)
103
+ - ✅ Remote logging to external services
104
+ - ✅ Analytics integration handlers
105
+ - ✅ Custom export format support
106
+ - ✅ Batch processing and buffering
107
+
108
+ ```typescript
109
+ // With export capabilities
110
+ import { Logger } from '@mks2508/better-logger-core';
111
+ import { FileLogHandler, RemoteLogHandler } from '@mks2508/better-logger-exports';
112
+
113
+ const logger = new Logger();
114
+
115
+ // Add file export
116
+ logger.addHandler(new FileLogHandler({
117
+ filename: 'app.log',
118
+ format: 'json',
119
+ maxSize: '10MB'
120
+ }));
121
+
122
+ // Add remote logging
123
+ logger.addHandler(new RemoteLogHandler({
124
+ endpoint: 'https://api.example.com/logs',
125
+ apiKey: 'your-key',
126
+ batchSize: 100
127
+ }));
128
+ ```
129
+
130
+ ---
131
+
132
+ ## 🔧 Build Your Own Stack
133
+
134
+ ### Minimal Setup (Core Only)
135
+ Perfect for lightweight applications or libraries.
136
+
137
+ ```typescript
138
+ import { Logger } from '@mks2508/better-logger-core';
139
+
140
+ const logger = new Logger({
141
+ prefix: '[MyApp]',
142
+ level: 'info'
143
+ });
144
+
145
+ export default logger;
146
+ ```
147
+ **Bundle size:** ~15KB
148
+
149
+ ### Visual Setup (Core + Styling)
150
+ For applications that need visual appeal in dev tools.
151
+
152
+ ```typescript
153
+ import { Logger } from '@mks2508/better-logger-core';
154
+ import { applyTheme } from '@mks2508/better-logger-styling';
155
+
156
+ const logger = new Logger();
157
+ applyTheme(logger, 'cyberpunk');
158
+
159
+ export default logger;
160
+ ```
161
+ **Bundle size:** ~27KB
162
+
163
+ ### Full-Featured Setup (All Packages)
164
+ Complete logging solution with all capabilities.
165
+
166
+ ```typescript
167
+ import { Logger } from '@mks2508/better-logger-core';
168
+ import { applyTheme } from '@mks2508/better-logger-styling';
169
+ import { FileLogHandler } from '@mks2508/better-logger-exports';
170
+
171
+ const logger = new Logger();
172
+ applyTheme(logger, 'matrix');
173
+ logger.addHandler(new FileLogHandler({ filename: 'app.log' }));
174
+
175
+ export default logger;
176
+ ```
177
+ **Bundle size:** ~45KB
178
+
179
+ ---
180
+
181
+ ## 📊 Performance Comparison
182
+
183
+ | Setup | Bundle Size | Load Time | Memory Usage | Features |
184
+ |-------|-------------|-----------|--------------|----------|
185
+ | Core Only | 15KB | <10ms | <2MB | Basic logging |
186
+ | Core + Styling | 27KB | <15ms | <3MB | Styled output |
187
+ | Core + Exports | 33KB | <20ms | <4MB | With file/remote |
188
+ | Full Package | 45KB | <25ms | <5MB | All features |
189
+
190
+ ---
191
+
192
+ ## 🔄 Migration Guide
193
+
194
+ ### From Full to Modular
195
+ If you want to reduce bundle size:
196
+
197
+ ```typescript
198
+ // Before: Full package
199
+ import { Logger } from '@mks2508/better-logger';
200
+
201
+ // After: Modular approach
202
+ import { Logger } from '@mks2508/better-logger-core';
203
+ import { applyTheme } from '@mks2508/better-logger-styling'; // Only if needed
204
+ ```
205
+
206
+ ### From v0.8.x to v0.1.0-rc.1
207
+ The package structure changed in v0.1.0-rc.1:
208
+
209
+ ```bash
210
+ # Update all packages
211
+ npm update @mks2508/better-logger@0.1.0-rc.1
212
+ npm update @mks2508/better-logger-core@0.1.0-rc.1
213
+ npm update @mks2508/better-logger-styling@0.1.0-rc.1
214
+ npm update @mks2508/better-logger-exports@0.1.0-rc.1
215
+ ```
216
+
217
+ ---
218
+
219
+ ## 🎯 Recommendations
220
+
221
+ ### For Libraries
222
+ Use **core-only** to minimize dependencies:
223
+ ```bash
224
+ npm install @mks2508/better-logger-core
225
+ ```
226
+
227
+ ### For Applications
228
+ Use **full package** for complete features:
229
+ ```bash
230
+ npm install @mks2508/better-logger
231
+ ```
232
+
233
+ ### For Production APIs
234
+ Use **core + exports** for logging + file/remote:
235
+ ```bash
236
+ npm install @mks2508/better-logger-core @mks2508/better-logger-exports
237
+ ```
238
+
239
+ ### For Development
240
+ Use **full package** with enhanced CLI:
241
+ ```bash
242
+ npm install @mks2508/better-logger
243
+ # Includes interactive CLI, history, plugins, etc.
244
+ ```
@@ -0,0 +1,36 @@
1
+ title: "Better Logger Documentation"
2
+ description: "State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface"
3
+ theme: minima
4
+ url: "https://mks2508.github.io"
5
+ baseurl: "/advanced-logger/docs"
6
+
7
+ markdown: kramdown
8
+ highlighter: rouge
9
+ kramdown:
10
+ syntax_highlighter: rouge
11
+
12
+ plugins:
13
+ - jekyll-feed
14
+ - jekyll-sitemap
15
+ - jekyll-seo-tag
16
+
17
+ exclude:
18
+ - Gemfile
19
+ - Gemfile.lock
20
+ - node_modules
21
+ - vendor/bundle/
22
+ - vendor/cache/
23
+ - vendor/gems/
24
+ - vendor/ruby/
25
+
26
+ header_pages:
27
+ - API.md
28
+ - DEVELOPMENT.md
29
+
30
+ navigation:
31
+ - title: API Reference
32
+ url: /advanced-logger/docs/API
33
+ - title: Development Guide
34
+ url: /advanced-logger/docs/DEVELOPMENT
35
+ - title: Live Demo
36
+ url: /advanced-logger/
package/docs/index.md ADDED
@@ -0,0 +1,179 @@
1
+ ---
2
+ layout: default
3
+ title: Better Logger Documentation
4
+ ---
5
+
6
+ # 🚀 Better Logger
7
+
8
+ **State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface**
9
+
10
+ [![NPM Version](https://img.shields.io/npm/v/@mks2508/better-logger)](https://www.npmjs.com/package/@mks2508/better-logger)
11
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@mks2508/better-logger)](https://bundlephobia.com/package/@mks2508/better-logger)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)
13
+ [![License](https://img.shields.io/npm/l/@mks2508/better-logger)](https://github.com/MKS2508/advanced-logger/blob/main/LICENSE)
14
+
15
+ Transform your console logging experience with beautiful styling, professional themes, and advanced features that make debugging and monitoring a visual delight.
16
+
17
+ ## ✨ Features
18
+
19
+ - 🎨 **Advanced CSS Styling** - Beautiful gradients, shadows, and animations
20
+ - 🌈 **5 Professional Themes** - Default, Dark, Neon, Cyberpunk, Retro
21
+ - 🖼️ **SVG Background Support** - Custom graphics in console output
22
+ - ⚡ **Performance Monitoring** - Built-in timing and benchmarking
23
+ - 📊 **Data Export** - CSV, JSON, XML export with filtering
24
+ - 📡 **Remote Logging** - Send logs to external services
25
+ - 💻 **Interactive CLI** - Built-in command interface
26
+ - 🔧 **Modular Architecture** - Import only what you need
27
+ - 📱 **Universal Compatibility** - Browser & Node.js with graceful fallbacks
28
+ - 🎯 **TypeScript First** - Complete type safety and IntelliSense
29
+
30
+ ## 📦 Installation
31
+
32
+ ```bash
33
+ npm install @mks2508/better-logger
34
+ ```
35
+
36
+ ## 🚀 Quick Start
37
+
38
+ ```typescript
39
+ import { Logger } from '@mks2508/better-logger';
40
+
41
+ const logger = new Logger({ prefix: 'APP' });
42
+
43
+ // Beautiful styled logging
44
+ logger.info('Application started', { version: '1.0.0' });
45
+ logger.success('Database connected successfully');
46
+ logger.warn('Memory usage high', { usage: '85%' });
47
+ logger.error('API request failed', { status: 500 });
48
+
49
+ // Performance timing
50
+ logger.time('operation');
51
+ await performOperation();
52
+ logger.timeEnd('operation'); // Shows duration with beautiful styling
53
+ ```
54
+
55
+ ## 🔧 Modular Usage
56
+
57
+ Import only what you need for optimal bundle sizes:
58
+
59
+ ```typescript
60
+ // Core logging only (6KB) - Essential features
61
+ import { Logger } from '@mks2508/better-logger/core';
62
+
63
+ // Styling features (26KB) - Themes, SVG, animations
64
+ import { setTheme, logAnimated } from '@mks2508/better-logger/styling';
65
+
66
+ // Export capabilities (12KB) - Data export, remote logging
67
+ import { ExportLogger } from '@mks2508/better-logger/exports';
68
+ ```
69
+
70
+ ## 📊 Bundle Analysis
71
+
72
+ | Module | Size | Gzipped | Best For |
73
+ |--------|------|---------|----------|
74
+ | **Core** | 6KB | 2KB | Essential logging, Node.js apps |
75
+ | **Styling** | 26KB | 5KB | Frontend apps, visual debugging |
76
+ | **Exports** | 12KB | 3KB | Production logging, analytics |
77
+ | **Full** | 64KB | 13KB | Complete feature set |
78
+
79
+ ## 📚 Documentation
80
+
81
+ ### 🎮 Interactive Demo
82
+ - **[🌟 Live Demo](https://mks2508.github.io/advanced-logger/)** - Try all features in your browser
83
+
84
+ ### 📖 Complete Documentation
85
+ - **[📋 API Reference](API)** - Complete method documentation
86
+ - **[🛠️ Development Guide](DEVELOPMENT)** - Use cases and development workflow
87
+
88
+ ### 🏃 Examples
89
+ ```bash
90
+ # Clone and try examples
91
+ git clone https://github.com/MKS2508/advanced-logger.git
92
+ cd advanced-logger/examples && npm install
93
+
94
+ npm run basic # Learn fundamentals
95
+ npm run performance # Master timing operations
96
+ npm run styling # Explore visual features
97
+ npm run export # Data management
98
+ ```
99
+
100
+ ## 🎨 Visual Showcase
101
+
102
+ ### Professional Themes
103
+ ```typescript
104
+ import { setTheme } from '@mks2508/better-logger/styling';
105
+
106
+ setTheme('cyberpunk'); // Purple/pink futuristic
107
+ setTheme('neon'); // Bright electric colors
108
+ setTheme('dark'); // Dark mode optimized
109
+ ```
110
+
111
+ ### Custom Styling
112
+ ```typescript
113
+ import { createStyle } from '@mks2508/better-logger/styling';
114
+
115
+ const customStyle = createStyle()
116
+ .bg('linear-gradient(45deg, #667eea, #764ba2)')
117
+ .color('white')
118
+ .padding('12px 24px')
119
+ .rounded('8px')
120
+ .shadow('0 4px 15px rgba(102, 126, 234, 0.4)')
121
+ .build();
122
+
123
+ console.log('%c🚀 Beautiful Custom Style!', customStyle);
124
+ ```
125
+
126
+ ## ⚡ Advanced Features
127
+
128
+ ### CLI Interface
129
+ ```typescript
130
+ import { initializeCLI } from '@mks2508/better-logger/cli';
131
+ initializeCLI(logger);
132
+
133
+ // Available in browser console:
134
+ // /help /theme /export /clear /status
135
+ ```
136
+
137
+ ### Performance Monitoring
138
+ ```typescript
139
+ logger.time('api-request');
140
+ const result = await fetch('/api/data');
141
+ logger.timeEnd('api-request'); // Automatic duration display
142
+ ```
143
+
144
+ ### Data Export
145
+ ```typescript
146
+ import { ExportLogger } from '@mks2508/better-logger/exports';
147
+
148
+ const logger = new ExportLogger();
149
+ const csvData = await logger.exportLogs('csv', {
150
+ filter: { level: 'error' },
151
+ limit: 100
152
+ });
153
+ ```
154
+
155
+ ## 🌐 Compatibility
156
+
157
+ - ✅ **All Modern Browsers** - Full feature support
158
+ - ✅ **Node.js** - Core features with graceful fallbacks
159
+ - ✅ **TypeScript** - Complete type definitions
160
+ - ✅ **ESM & CommonJS** - Both module systems supported
161
+
162
+ ## 🔗 Resources
163
+
164
+ - 📦 **[NPM Package](https://www.npmjs.com/package/@mks2508/better-logger)**
165
+ - 📚 **[GitHub Repository](https://github.com/MKS2508/advanced-logger)**
166
+ - 🧩 **[Examples](https://github.com/MKS2508/advanced-logger/tree/main/examples)**
167
+ - 🐛 **[Issues & Support](https://github.com/MKS2508/advanced-logger/issues)**
168
+
169
+ ## 🤝 Contributing
170
+
171
+ Contributions welcome! See our [Contributing Guide](https://github.com/MKS2508/advanced-logger/blob/main/CONTRIBUTING.md) for details.
172
+
173
+ ## 📄 License
174
+
175
+ MIT License - see [LICENSE](https://github.com/MKS2508/advanced-logger/blob/main/LICENSE) for details.
176
+
177
+ ---
178
+
179
+ **Made with ❤️ by [MKS2508](https://github.com/MKS2508)**
@@ -0,0 +1,208 @@
1
+ # 📚 Better Logger Examples
2
+
3
+ This directory contains practical examples demonstrating various features of Better Logger.
4
+
5
+ ## 🚀 Quick Start
6
+
7
+ ```bash
8
+ # Install dependencies
9
+ cd examples
10
+ npm install
11
+
12
+ # Run all examples
13
+ npm run all
14
+
15
+ # Or run individual examples
16
+ npm run basic # Basic logging features
17
+ npm run performance # Performance timing
18
+ npm run styling # Themes and visual styling
19
+ npm run export # Data export and remote logging
20
+ ```
21
+
22
+ ## 📋 Available Examples
23
+
24
+ ### 1. 🔤 Basic Logging (`basic-logging.js`)
25
+
26
+ Learn the fundamentals of logging with Better Logger:
27
+
28
+ - **Log Levels**: debug, info, warn, error, critical, success
29
+ - **Data Types**: Strings, numbers, booleans, arrays, objects, errors
30
+ - **Message Formatting**: Multiple arguments and structured data
31
+ - **Practical Usage**: Real-world logging scenarios
32
+
33
+ **Key Features Demonstrated:**
34
+ ```javascript
35
+ logger.info('User login', { userId: 123, method: 'oauth' });
36
+ logger.error('Connection failed', error);
37
+ logger.success('Operation completed', { duration: '2.5s' });
38
+ ```
39
+
40
+ **Run:** `npm run basic`
41
+
42
+ ---
43
+
44
+ ### 2. ⏱️ Performance Timing (`performance-timing.js`)
45
+
46
+ Master performance monitoring and timing operations:
47
+
48
+ - **Basic Timing**: `time()` and `timeEnd()` operations
49
+ - **Intermediate Timing**: `timeLog()` for step-by-step tracking
50
+ - **Concurrent Operations**: Multiple timers running simultaneously
51
+ - **Nested Timing**: Parent and child operation tracking
52
+ - **Performance Comparison**: Benchmarking different approaches
53
+
54
+ **Key Features Demonstrated:**
55
+ ```javascript
56
+ logger.time('database-query');
57
+ const result = await executeQuery();
58
+ logger.timeLog('database-query', 'Query executed');
59
+ logger.timeEnd('database-query');
60
+ ```
61
+
62
+ **Run:** `npm run performance`
63
+
64
+ ---
65
+
66
+ ### 3. 🎨 Styling & Themes (`styling-themes.js`)
67
+
68
+ Explore visual customization and theming capabilities:
69
+
70
+ - **Theme System**: 5 built-in themes (default, dark, neon, cyberpunk, retro)
71
+ - **Banner Types**: ASCII, Unicode, SVG, and animated banners
72
+ - **Custom Styles**: StyleBuilder API for creating unique appearances
73
+ - **Style Presets**: Ready-to-use styles for common scenarios
74
+ - **SVG Integration**: Custom graphics in console output (browser)
75
+
76
+ **Key Features Demonstrated:**
77
+ ```javascript
78
+ setTheme('cyberpunk');
79
+ const customStyle = createStyle()
80
+ .bg('linear-gradient(45deg, #ff6b6b, #feca57)')
81
+ .color('white')
82
+ .padding('12px 24px')
83
+ .rounded('8px')
84
+ .build();
85
+ ```
86
+
87
+ **Run:** `npm run styling`
88
+
89
+ **Note:** Best viewed in browser console for full visual effects.
90
+
91
+ ---
92
+
93
+ ### 4. 📤 Data Export & Remote (`data-export.js`)
94
+
95
+ Learn data management, export, and remote logging:
96
+
97
+ - **Log Buffering**: Circular buffer management with configurable size
98
+ - **Export Formats**: CSV, JSON, XML with filtering options
99
+ - **Remote Logging**: HTTP and WebSocket endpoint simulation
100
+ - **Analytics**: Log statistics and performance metrics
101
+ - **Filtering**: Advanced search and filtering capabilities
102
+
103
+ **Key Features Demonstrated:**
104
+ ```javascript
105
+ const csvData = await logger.exportLogs('csv', {
106
+ filter: { level: 'error', from: yesterday },
107
+ limit: 100
108
+ });
109
+
110
+ logger.addRemoteHandler('https://api.logs.com', {
111
+ apiKey: 'secret-key',
112
+ batchSize: 10
113
+ });
114
+ ```
115
+
116
+ **Run:** `npm run export`
117
+
118
+ **Output:** Creates `exports/` directory with sample export files.
119
+
120
+ ---
121
+
122
+ ## 🎯 Learning Path
123
+
124
+ ### Beginner (Start Here)
125
+ 1. **Basic Logging** - Learn core logging methods
126
+ 2. **Performance Timing** - Add timing to your applications
127
+
128
+ ### Intermediate
129
+ 3. **Styling & Themes** - Customize visual appearance
130
+ 4. **Data Export** - Implement log management
131
+
132
+ ### Advanced
133
+ - Combine examples to create comprehensive logging solutions
134
+ - Explore the full [API Reference](../docs/API.md)
135
+ - Check out the [Interactive Demo](https://mks2508.github.io/advanced-logger/)
136
+
137
+ ## 💡 Tips for Running Examples
138
+
139
+ ### Node.js Environment
140
+ All examples work in Node.js, but some visual features are optimized for browsers:
141
+
142
+ ```bash
143
+ # Works everywhere
144
+ npm run basic
145
+ npm run performance
146
+ npm run export
147
+
148
+ # Limited visual effects in Node.js
149
+ npm run styling
150
+ ```
151
+
152
+ ### Browser Environment
153
+ For full visual experience with styling and animations:
154
+
155
+ 1. Import Better Logger in your browser console:
156
+ ```javascript
157
+ // Using CDN
158
+ import('https://unpkg.com/@mks2508/better-logger@latest')
159
+ ```
160
+
161
+ 2. Copy and paste example code from `styling-themes.js`
162
+
163
+ ### File Outputs
164
+ The `data-export.js` example creates files in the `exports/` directory:
165
+
166
+ ```
167
+ exports/
168
+ ├── logs-all.csv # All logs in CSV format
169
+ ├── logs-errors.json # Error logs in JSON format
170
+ ├── logs-recent.xml # Recent logs in XML format
171
+ └── logs-24h.json # Last 24 hours in JSON format
172
+ ```
173
+
174
+ ## 🔗 Related Resources
175
+
176
+ - 📚 [API Reference](../docs/API.md) - Complete method documentation
177
+ - 🎮 [Interactive Demo](https://mks2508.github.io/advanced-logger/) - Try features live
178
+ - 📦 [NPM Package](https://www.npmjs.com/package/@mks2508/better-logger) - Installation guide
179
+ - 🐛 [Issues & Support](https://github.com/MKS2508/advanced-logger/issues) - Get help
180
+
181
+ ## 🤝 Contributing Examples
182
+
183
+ Have a useful logging pattern or use case? We'd love to see your examples!
184
+
185
+ 1. Create a new `.js` file following the existing pattern
186
+ 2. Add a script to `package.json`
187
+ 3. Update this README with documentation
188
+ 4. Submit a pull request
189
+
190
+ **Example Template:**
191
+ ```javascript
192
+ /**
193
+ * [Feature Name] Example
194
+ *
195
+ * Demonstrates [specific capabilities] including:
196
+ * - Feature 1
197
+ * - Feature 2
198
+ * - Feature 3
199
+ *
200
+ * Run: node examples/your-example.js
201
+ */
202
+
203
+ // Your example code here
204
+ ```
205
+
206
+ ---
207
+
208
+ Happy logging! 🎉