@mks2508/better-logger 0.14.0-alpha.2 ā 0.18.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -244
- package/dist/Logger.d.ts +662 -202
- package/dist/Logger.d.ts.map +1 -1
- package/dist/ScopedLogger.d.ts +434 -175
- package/dist/ScopedLogger.d.ts.map +1 -1
- package/dist/chunks/HookBridge-C-AvXmPD.cjs +504 -0
- package/dist/chunks/HookBridge-C-AvXmPD.cjs.map +1 -0
- package/dist/chunks/HookBridge-CI2PH79S.js +487 -0
- package/dist/chunks/HookBridge-CI2PH79S.js.map +1 -0
- package/dist/chunks/LogContext-BaMXleWj.cjs +105 -0
- package/dist/chunks/LogContext-BaMXleWj.cjs.map +1 -0
- package/dist/chunks/LogContext-DjlITOzZ.js +100 -0
- package/dist/chunks/LogContext-DjlITOzZ.js.map +1 -0
- package/dist/chunks/SerializerBridge-Ba43Mk7j.js +393 -0
- package/dist/chunks/SerializerBridge-Ba43Mk7j.js.map +1 -0
- package/dist/chunks/SerializerBridge-C4a9Z37F.cjs +410 -0
- package/dist/chunks/SerializerBridge-C4a9Z37F.cjs.map +1 -0
- package/dist/chunks/StyleManager-DQ6UNRB-.cjs +118 -0
- package/dist/chunks/StyleManager-DQ6UNRB-.cjs.map +1 -0
- package/dist/chunks/StyleManager-DjwAYbxE.js +113 -0
- package/dist/chunks/StyleManager-DjwAYbxE.js.map +1 -0
- package/dist/chunks/core-Blfi2klP.js +31 -0
- package/dist/chunks/core-Blfi2klP.js.map +1 -0
- package/dist/chunks/core-CqS_UBzJ.cjs +36 -0
- package/dist/chunks/core-CqS_UBzJ.cjs.map +1 -0
- package/dist/chunks/environment-detector-7NvnYUfr.js +110 -0
- package/dist/chunks/environment-detector-7NvnYUfr.js.map +1 -0
- package/dist/chunks/environment-detector-D-tHkKWA.cjs +163 -0
- package/dist/chunks/environment-detector-D-tHkKWA.cjs.map +1 -0
- package/dist/chunks/server-fallback-CaCPjWby.cjs +119 -0
- package/dist/chunks/server-fallback-CaCPjWby.cjs.map +1 -0
- package/dist/chunks/server-fallback-jj0T6XaK.js +114 -0
- package/dist/chunks/server-fallback-jj0T6XaK.js.map +1 -0
- package/dist/chunks/spinner-BHyYEXsM.cjs +1029 -0
- package/dist/chunks/spinner-BHyYEXsM.cjs.map +1 -0
- package/dist/chunks/spinner-BtkwpzYv.js +982 -0
- package/dist/chunks/spinner-BtkwpzYv.js.map +1 -0
- package/dist/chunks/styling-CRw3KQW4.js +1592 -0
- package/dist/chunks/styling-CRw3KQW4.js.map +1 -0
- package/dist/chunks/styling-Cel2wPRy.cjs +1645 -0
- package/dist/chunks/styling-Cel2wPRy.cjs.map +1 -0
- package/dist/chunks/transports-BGfwwakw.js +1237 -0
- package/dist/chunks/transports-BGfwwakw.js.map +1 -0
- package/dist/chunks/transports-yK6CL0Ml.cjs +1278 -0
- package/dist/chunks/transports-yK6CL0Ml.cjs.map +1 -0
- package/dist/chunks/utils-W_cxqriN.cjs +705 -0
- package/dist/chunks/utils-W_cxqriN.cjs.map +1 -0
- package/dist/chunks/utils-tKfBAWUM.js +586 -0
- package/dist/chunks/utils-tKfBAWUM.js.map +1 -0
- package/dist/cli/CommandProcessor.d.ts +166 -19
- package/dist/cli/CommandProcessor.d.ts.map +1 -1
- package/dist/cli/commands/ConfigCommand.d.ts +36 -1
- package/dist/cli/commands/ConfigCommand.d.ts.map +1 -1
- package/dist/cli/commands/ExportCommand.d.ts +54 -26
- package/dist/cli/commands/ExportCommand.d.ts.map +1 -1
- package/dist/cli/commands/ThemeCommand.d.ts +62 -3
- package/dist/cli/commands/ThemeCommand.d.ts.map +1 -1
- package/dist/cli/help.d.ts +30 -2
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/index.d.ts +30 -4
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli-module.d.ts +13 -0
- package/dist/cli-module.d.ts.map +1 -0
- package/dist/cli.cjs +11 -0
- package/dist/cli.js +3 -0
- package/dist/constants.d.ts +16 -47
- package/dist/constants.d.ts.map +1 -1
- package/dist/context/LogContext.d.ts +245 -0
- package/dist/context/LogContext.d.ts.map +1 -0
- package/dist/context/index.d.ts +6 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context-module.d.ts +6 -0
- package/dist/context-module.d.ts.map +1 -0
- package/dist/context.cjs +3 -0
- package/dist/context.js +2 -0
- package/dist/core.cjs +304 -2
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +56 -34
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +281 -314
- package/dist/core.js.map +1 -1
- package/dist/hooks/HookBridge.d.ts +32 -0
- package/dist/hooks/HookBridge.d.ts.map +1 -0
- package/dist/hooks/HookManager.d.ts +319 -0
- package/dist/hooks/HookManager.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks-module.d.ts +7 -0
- package/dist/hooks-module.d.ts.map +1 -0
- package/dist/hooks.cjs +5 -0
- package/dist/hooks.js +2 -0
- package/dist/index.cjs +3402 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +42 -130
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3327 -158
- package/dist/index.js.map +1 -1
- package/dist/node-module.d.ts +10 -0
- package/dist/node-module.d.ts.map +1 -0
- package/dist/node.cjs +13 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.js +12 -0
- package/dist/node.js.map +1 -0
- package/dist/playground/TerminalBridge.d.ts +53 -0
- package/dist/playground/TerminalBridge.d.ts.map +1 -0
- package/dist/playground/box.d.ts +45 -0
- package/dist/playground/box.d.ts.map +1 -0
- package/dist/playground/cli-table.d.ts +50 -0
- package/dist/playground/cli-table.d.ts.map +1 -0
- package/dist/playground/divider.d.ts +29 -0
- package/dist/playground/divider.d.ts.map +1 -0
- package/dist/playground/header.d.ts +28 -0
- package/dist/playground/header.d.ts.map +1 -0
- package/dist/playground/index.d.ts +11 -0
- package/dist/playground/index.d.ts.map +1 -0
- package/dist/playground/server-fallback.d.ts +114 -0
- package/dist/playground/server-fallback.d.ts.map +1 -0
- package/dist/playground/spinner.d.ts +197 -0
- package/dist/playground/spinner.d.ts.map +1 -0
- package/dist/playground/step.d.ts +33 -0
- package/dist/playground/step.d.ts.map +1 -0
- package/dist/playground-module.d.ts +11 -0
- package/dist/playground-module.d.ts.map +1 -0
- package/dist/playground.cjs +9 -0
- package/dist/playground.js +2 -0
- package/dist/serializers/SerializerBridge.d.ts +28 -0
- package/dist/serializers/SerializerBridge.d.ts.map +1 -0
- package/dist/serializers/SerializerRegistry.d.ts +252 -0
- package/dist/serializers/SerializerRegistry.d.ts.map +1 -0
- package/dist/serializers/index.d.ts +7 -0
- package/dist/serializers/index.d.ts.map +1 -0
- package/dist/serializers-module.d.ts +7 -0
- package/dist/serializers-module.d.ts.map +1 -0
- package/dist/serializers.cjs +5 -0
- package/dist/serializers.js +2 -0
- package/dist/styles/StyleManager.d.ts +190 -0
- package/dist/styles/StyleManager.d.ts.map +1 -0
- package/dist/styles/index.d.ts +7 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles-module.d.ts +7 -0
- package/dist/styles-module.d.ts.map +1 -0
- package/dist/styles.cjs +7 -0
- package/dist/styles.js +3 -0
- package/dist/styling/SmartPresets.d.ts +100 -6
- package/dist/styling/SmartPresets.d.ts.map +1 -1
- package/dist/styling/StyleBuilder.d.ts +453 -32
- package/dist/styling/StyleBuilder.d.ts.map +1 -1
- package/dist/styling/banners.d.ts +85 -5
- package/dist/styling/banners.d.ts.map +1 -1
- package/dist/styling/index.d.ts +8 -3
- package/dist/styling/index.d.ts.map +1 -1
- package/dist/styling/themes.d.ts +41 -2
- package/dist/styling/themes.d.ts.map +1 -1
- package/dist/terminal/color-converter.d.ts +73 -0
- package/dist/terminal/color-converter.d.ts.map +1 -0
- package/dist/terminal/formatter.d.ts +23 -0
- package/dist/terminal/formatter.d.ts.map +1 -0
- package/dist/transports/ConsoleTransport.d.ts +104 -0
- package/dist/transports/ConsoleTransport.d.ts.map +1 -0
- package/dist/transports/FileTransport.d.ts +137 -0
- package/dist/transports/FileTransport.d.ts.map +1 -0
- package/dist/transports/HttpTransport.d.ts +180 -0
- package/dist/transports/HttpTransport.d.ts.map +1 -0
- package/dist/transports/OtlpTransport.d.ts +165 -0
- package/dist/transports/OtlpTransport.d.ts.map +1 -0
- package/dist/transports/TransportBridge.d.ts +43 -0
- package/dist/transports/TransportBridge.d.ts.map +1 -0
- package/dist/transports/TransportManager.d.ts +251 -0
- package/dist/transports/TransportManager.d.ts.map +1 -0
- package/dist/transports/index.d.ts +6 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/dist/transports-module.d.ts +10 -0
- package/dist/transports-module.d.ts.map +1 -0
- package/dist/transports.cjs +7 -0
- package/dist/transports.js +2 -0
- package/dist/types/core.d.ts +295 -17
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/handlers.d.ts +0 -67
- package/dist/types/handlers.d.ts.map +1 -1
- package/dist/types/hooks.d.ts +138 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/serializers.d.ts +97 -0
- package/dist/types/serializers.d.ts.map +1 -0
- package/dist/types/transports.d.ts +132 -0
- package/dist/types/transports.d.ts.map +1 -0
- package/dist/utils/ansi-colors.d.ts +115 -0
- package/dist/utils/ansi-colors.d.ts.map +1 -0
- package/dist/utils/environment-detector.d.ts +53 -0
- package/dist/utils/environment-detector.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +9 -8
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/output.d.ts +14 -17
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/stackTrace.d.ts +2 -2
- package/dist/utils/stackTrace.d.ts.map +1 -1
- package/dist/utils/timestamps.d.ts +0 -12
- package/dist/utils/timestamps.d.ts.map +1 -1
- package/package.json +95 -21
- package/.claude/settings.local.json +0 -39
- package/.github/workflows/ci-quality.yml +0 -357
- package/.github/workflows/docs-demo.yml +0 -119
- package/.github/workflows/releases-core.yml +0 -512
- package/.github/workflows/releases-full.yml +0 -582
- package/.github/workflows-backup/ci.yml +0 -221
- package/.github/workflows-backup/nightly.yml +0 -196
- package/.github/workflows-backup/release-optimized.yml +0 -373
- package/.github/workflows-backup/release.yml +0 -269
- package/.release-notes-0.2.0.md +0 -129
- package/.yamllint +0 -28
- package/CHANGELOG.json +0 -865
- package/CLAUDE.md +0 -204
- package/bun.lock +0 -323
- package/demo.html +0 -847
- package/dist/.tsbuildinfo +0 -1
- package/dist/Logger.js +0 -1124
- package/dist/ScopedLogger.js +0 -426
- package/dist/chunks/Logger-Crw1woqR.js +0 -3464
- package/dist/chunks/Logger-Crw1woqR.js.map +0 -1
- package/dist/chunks/Logger-D_p3xnbq.js +0 -2
- package/dist/chunks/Logger-D_p3xnbq.js.map +0 -1
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +0 -33
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +0 -1
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +0 -2
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +0 -1
- package/dist/chunks/environment-Bxbnw4pd.js +0 -544
- package/dist/chunks/environment-Bxbnw4pd.js.map +0 -1
- package/dist/chunks/environment-Dm66zOML.js +0 -4
- package/dist/chunks/environment-Dm66zOML.js.map +0 -1
- package/dist/chunks/formatting-C0riPC5_.js +0 -95
- package/dist/chunks/formatting-C0riPC5_.js.map +0 -1
- package/dist/chunks/formatting-DNCAV66-.js +0 -2
- package/dist/chunks/formatting-DNCAV66-.js.map +0 -1
- package/dist/cli/CommandProcessor.js +0 -184
- package/dist/cli/commands/ConfigCommand.js +0 -88
- package/dist/cli/commands/ExportCommand.js +0 -243
- package/dist/cli/commands/HistoryCommand.d.ts +0 -50
- package/dist/cli/commands/HistoryCommand.d.ts.map +0 -1
- package/dist/cli/commands/HistoryCommand.js +0 -96
- package/dist/cli/commands/StatusCommand.d.ts +0 -33
- package/dist/cli/commands/StatusCommand.d.ts.map +0 -1
- package/dist/cli/commands/StatusCommand.js +0 -93
- package/dist/cli/commands/ThemeCommand.js +0 -79
- package/dist/cli/help.js +0 -118
- package/dist/cli/index.js +0 -46
- package/dist/constants.js +0 -159
- package/dist/example.d.ts +0 -18
- package/dist/example.d.ts.map +0 -1
- package/dist/example.js +0 -154
- package/dist/exports-module.d.ts +0 -203
- package/dist/exports-module.d.ts.map +0 -1
- package/dist/exports-module.js +0 -260
- package/dist/exports.cjs +0 -2
- package/dist/exports.cjs.map +0 -1
- package/dist/exports.js +0 -238
- package/dist/exports.js.map +0 -1
- package/dist/handlers/AnalyticsLogHandler.d.ts +0 -11
- package/dist/handlers/AnalyticsLogHandler.d.ts.map +0 -1
- package/dist/handlers/AnalyticsLogHandler.js +0 -19
- package/dist/handlers/ExportLogHandler.d.ts +0 -103
- package/dist/handlers/ExportLogHandler.d.ts.map +0 -1
- package/dist/handlers/ExportLogHandler.js +0 -516
- package/dist/handlers/FileLogHandler.d.ts +0 -36
- package/dist/handlers/FileLogHandler.d.ts.map +0 -1
- package/dist/handlers/FileLogHandler.js +0 -156
- package/dist/handlers/RemoteLogHandler.d.ts +0 -14
- package/dist/handlers/RemoteLogHandler.d.ts.map +0 -1
- package/dist/handlers/RemoteLogHandler.js +0 -37
- package/dist/handlers/index.d.ts +0 -8
- package/dist/handlers/index.d.ts.map +0 -1
- package/dist/handlers/index.js +0 -7
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -139
- package/dist/styling/LogStyleBuilder.d.ts +0 -149
- package/dist/styling/LogStyleBuilder.d.ts.map +0 -1
- package/dist/styling/LogStyleBuilder.js +0 -289
- package/dist/styling/SemanticStyles.d.ts +0 -181
- package/dist/styling/SemanticStyles.d.ts.map +0 -1
- package/dist/styling/SemanticStyles.js +0 -339
- package/dist/styling/SmartPresets.js +0 -276
- package/dist/styling/StyleBuilder.js +0 -280
- package/dist/styling/banners.js +0 -155
- package/dist/styling/index.js +0 -9
- package/dist/styling/themes.js +0 -231
- package/dist/styling-module.d.ts +0 -185
- package/dist/styling-module.d.ts.map +0 -1
- package/dist/styling-module.js +0 -199
- package/dist/styling.cjs +0 -2
- package/dist/styling.cjs.map +0 -1
- package/dist/styling.js +0 -146
- package/dist/styling.js.map +0 -1
- package/dist/types/Logger.d.ts +0 -700
- package/dist/types/Logger.d.ts.map +0 -1
- package/dist/types/ScopedLogger.d.ts +0 -310
- package/dist/types/ScopedLogger.d.ts.map +0 -1
- package/dist/types/cli/CommandProcessor.d.ts +0 -100
- package/dist/types/cli/CommandProcessor.d.ts.map +0 -1
- package/dist/types/cli/commands/ConfigCommand.d.ts +0 -14
- package/dist/types/cli/commands/ConfigCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/ExportCommand.d.ts +0 -48
- package/dist/types/cli/commands/ExportCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/HistoryCommand.d.ts +0 -47
- package/dist/types/cli/commands/HistoryCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/StatusCommand.d.ts +0 -30
- package/dist/types/cli/commands/StatusCommand.d.ts.map +0 -1
- package/dist/types/cli/commands/ThemeCommand.d.ts +0 -30
- package/dist/types/cli/commands/ThemeCommand.d.ts.map +0 -1
- package/dist/types/cli/help.d.ts +0 -12
- package/dist/types/cli/help.d.ts.map +0 -1
- package/dist/types/cli/index.d.ts +0 -15
- package/dist/types/cli/index.d.ts.map +0 -1
- package/dist/types/constants.d.ts +0 -119
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/core.js +0 -28
- package/dist/types/example.d.ts +0 -18
- package/dist/types/example.d.ts.map +0 -1
- package/dist/types/exports-module.d.ts +0 -196
- package/dist/types/exports-module.d.ts.map +0 -1
- package/dist/types/handlers/AnalyticsLogHandler.d.ts +0 -8
- package/dist/types/handlers/AnalyticsLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/ExportLogHandler.d.ts +0 -100
- package/dist/types/handlers/ExportLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/FileLogHandler.d.ts +0 -33
- package/dist/types/handlers/FileLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/RemoteLogHandler.d.ts +0 -11
- package/dist/types/handlers/RemoteLogHandler.d.ts.map +0 -1
- package/dist/types/handlers/index.d.ts +0 -8
- package/dist/types/handlers/index.d.ts.map +0 -1
- package/dist/types/handlers.js +0 -4
- package/dist/types/index.js +0 -4
- package/dist/types/main.d.ts +0 -2
- package/dist/types/main.d.ts.map +0 -1
- package/dist/types/styling/LogStyleBuilder.d.ts +0 -146
- package/dist/types/styling/LogStyleBuilder.d.ts.map +0 -1
- package/dist/types/styling/SemanticStyles.d.ts +0 -178
- package/dist/types/styling/SemanticStyles.d.ts.map +0 -1
- package/dist/types/styling/SmartPresets.d.ts +0 -22
- package/dist/types/styling/SmartPresets.d.ts.map +0 -1
- package/dist/types/styling/StyleBuilder.d.ts +0 -140
- package/dist/types/styling/StyleBuilder.d.ts.map +0 -1
- package/dist/types/styling/banners.d.ts +0 -42
- package/dist/types/styling/banners.d.ts.map +0 -1
- package/dist/types/styling/index.d.ts +0 -10
- package/dist/types/styling/index.d.ts.map +0 -1
- package/dist/types/styling/themes.d.ts +0 -7
- package/dist/types/styling/themes.d.ts.map +0 -1
- package/dist/types/styling-module.d.ts +0 -178
- package/dist/types/styling-module.d.ts.map +0 -1
- package/dist/types/types/core.d.ts +0 -221
- package/dist/types/types/core.d.ts.map +0 -1
- package/dist/types/types/handlers.d.ts +0 -85
- package/dist/types/types/handlers.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -7
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/utils/environment.d.ts +0 -47
- package/dist/types/utils/environment.d.ts.map +0 -1
- package/dist/types/utils/formatting.d.ts +0 -37
- package/dist/types/utils/formatting.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -7
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/opentui-detection.d.ts +0 -34
- package/dist/types/utils/opentui-detection.d.ts.map +0 -1
- package/dist/types/utils/output.d.ts +0 -41
- package/dist/types/utils/output.d.ts.map +0 -1
- package/dist/types/utils/stackTrace.d.ts +0 -6
- package/dist/types/utils/stackTrace.d.ts.map +0 -1
- package/dist/types/utils/timestamps.d.ts +0 -20
- package/dist/types/utils/timestamps.d.ts.map +0 -1
- package/dist/utils/environment.d.ts +0 -47
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/environment.js +0 -85
- package/dist/utils/formatting.js +0 -117
- package/dist/utils/index.js +0 -6
- package/dist/utils/opentui-detection.d.ts +0 -34
- package/dist/utils/opentui-detection.d.ts.map +0 -1
- package/dist/utils/opentui-detection.js +0 -116
- package/dist/utils/output.js +0 -150
- package/dist/utils/stackTrace.js +0 -81
- package/dist/utils/timestamps.js +0 -71
- package/dist/vite.svg +0 -1
- package/docs/API.md +0 -691
- package/docs/CORE.md +0 -264
- package/docs/DEVELOPMENT.md +0 -731
- package/docs/EXPORTS.md +0 -467
- package/docs/PACKAGES.md +0 -244
- package/docs/STYLING.md +0 -405
- package/docs/_config.yml +0 -36
- package/docs/index.md +0 -179
- package/examples/README.md +0 -208
- package/examples/basic-logging.js +0 -75
- package/examples/data-export.js +0 -234
- package/examples/package.json +0 -16
- package/examples/performance-timing.js +0 -170
- package/examples/simplified-api.js +0 -124
- package/examples/styling-themes.js +0 -207
- package/index.html +0 -358
- package/packages/core/package.json +0 -57
- package/packages/exports/package.json +0 -41
- package/packages/nodejs-opentui/README.md +0 -232
- package/packages/nodejs-opentui/package.json +0 -72
- package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
- package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
- package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
- package/packages/nodejs-opentui/src/index.ts +0 -133
- package/packages/nodejs-opentui/src/types.ts +0 -158
- package/packages/nodejs-opentui/tsconfig.json +0 -20
- package/packages/styling/package.json +0 -41
- package/project-utils/README.md +0 -172
- package/project-utils/auto-release-gemini.ts +0 -1193
- package/project-utils/auto-release-ui.ts +0 -1329
- package/project-utils/commit-generator.ts +0 -1385
- package/project-utils/commit-ui.ts +0 -264
- package/project-utils/git-utils.ts +0 -199
- package/project-utils/github-release-manager.ts +0 -466
- package/project-utils/project-config.ts +0 -260
- package/project-utils/prompt-templates.js +0 -345
- package/project-utils/prompt-templates.ts +0 -422
- package/project-utils/version-manager.ts +0 -1078
- package/public/vite.svg +0 -1
- package/src/Logger.ts +0 -1276
- package/src/ScopedLogger.ts +0 -454
- package/src/cli/CommandProcessor.ts +0 -248
- package/src/cli/commands/ConfigCommand.ts +0 -93
- package/src/cli/commands/ExportCommand.ts +0 -276
- package/src/cli/commands/HistoryCommand.ts +0 -117
- package/src/cli/commands/StatusCommand.ts +0 -112
- package/src/cli/commands/ThemeCommand.ts +0 -88
- package/src/cli/help.ts +0 -127
- package/src/cli/index.ts +0 -71
- package/src/constants.ts +0 -171
- package/src/core.ts +0 -393
- package/src/example.ts +0 -210
- package/src/exports-module.ts +0 -311
- package/src/handlers/AnalyticsLogHandler.ts +0 -22
- package/src/handlers/ExportLogHandler.ts +0 -609
- package/src/handlers/FileLogHandler.ts +0 -169
- package/src/handlers/RemoteLogHandler.ts +0 -42
- package/src/handlers/index.ts +0 -8
- package/src/index.ts +0 -209
- package/src/main.ts +0 -196
- package/src/style.css +0 -96
- package/src/styling/LogStyleBuilder.ts +0 -355
- package/src/styling/SemanticStyles.ts +0 -380
- package/src/styling/SmartPresets.ts +0 -288
- package/src/styling/StyleBuilder.ts +0 -319
- package/src/styling/banners.ts +0 -168
- package/src/styling/index.ts +0 -27
- package/src/styling/themes.ts +0 -235
- package/src/styling-module.ts +0 -244
- package/src/types/core.ts +0 -236
- package/src/types/handlers.ts +0 -95
- package/src/types/index.ts +0 -35
- package/src/typescript.svg +0 -1
- package/src/utils/environment.ts +0 -94
- package/src/utils/formatting.ts +0 -142
- package/src/utils/index.ts +0 -21
- package/src/utils/opentui-detection.ts +0 -138
- package/src/utils/output.ts +0 -185
- package/src/utils/stackTrace.ts +0 -95
- package/src/utils/timestamps.ts +0 -80
- package/src/vite-env.d.ts +0 -1
- package/test-core-browser.html +0 -237
- package/test-core-node.js +0 -63
- package/tests/test-conflict-resolution.ts +0 -391
- package/tests/validate-workflows.sh +0 -131
- package/tests/yaml-autofix.sh +0 -146
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -223
package/src/core.ts
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Core Logger Module - Minimal logging without advanced features
|
|
3
|
-
* @version 0.0.1
|
|
4
|
-
*
|
|
5
|
-
* This module provides the essential logging functionality without visual enhancements,
|
|
6
|
-
* SVG support, or advanced styling. Perfect for lightweight applications or server-side usage.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// Core types
|
|
10
|
-
import type {
|
|
11
|
-
LogLevel,
|
|
12
|
-
Verbosity,
|
|
13
|
-
LoggerConfig,
|
|
14
|
-
ILogHandler,
|
|
15
|
-
LogMetadata,
|
|
16
|
-
TimerEntry
|
|
17
|
-
} from './types/index.js';
|
|
18
|
-
|
|
19
|
-
// Core utilities
|
|
20
|
-
import {
|
|
21
|
-
parseStackTrace,
|
|
22
|
-
formatTimestamp
|
|
23
|
-
} from './utils/index.js';
|
|
24
|
-
|
|
25
|
-
// Universal formatting and environment detection
|
|
26
|
-
import {
|
|
27
|
-
createPlainOutput,
|
|
28
|
-
getConsoleMethod,
|
|
29
|
-
createLogEntry,
|
|
30
|
-
formatTablePlain,
|
|
31
|
-
safeSerialize
|
|
32
|
-
} from './utils/formatting.js';
|
|
33
|
-
|
|
34
|
-
import {
|
|
35
|
-
isBrowser,
|
|
36
|
-
isNode,
|
|
37
|
-
getRuntimeEnvironment,
|
|
38
|
-
supportsColors,
|
|
39
|
-
supportsCSSColors
|
|
40
|
-
} from './utils/environment.js';
|
|
41
|
-
|
|
42
|
-
import { createStyledOutput } from './utils/output.js';
|
|
43
|
-
|
|
44
|
-
// Constants
|
|
45
|
-
import { DEFAULT_CONFIG, LEVEL_STYLES } from './constants.js';
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Minimal Logger class with core functionality only
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* import { CoreLogger } from '@mks2508/better-logger/core';
|
|
53
|
-
*
|
|
54
|
-
* const logger = new CoreLogger();
|
|
55
|
-
* logger.info('Hello world');
|
|
56
|
-
* logger.error('Something went wrong', error);
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export class CoreLogger {
|
|
60
|
-
private config: LoggerConfig;
|
|
61
|
-
private scopedPrefix?: string;
|
|
62
|
-
private handlers: ILogHandler[] = [];
|
|
63
|
-
private timers: Map<string, TimerEntry> = new Map();
|
|
64
|
-
private groupDepth: number = 0;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Creates a new CoreLogger instance
|
|
68
|
-
* @param config - Optional configuration
|
|
69
|
-
*/
|
|
70
|
-
constructor(config: Partial<LoggerConfig> = {}) {
|
|
71
|
-
this.config = {
|
|
72
|
-
...DEFAULT_CONFIG,
|
|
73
|
-
...config,
|
|
74
|
-
// Auto-configure based on environment
|
|
75
|
-
enableColors: config.enableColors ?? (isBrowser ? true : false),
|
|
76
|
-
enableTimestamps: config.enableTimestamps ?? true,
|
|
77
|
-
enableStackTrace: config.enableStackTrace ?? false,
|
|
78
|
-
autoDetectTheme: config.autoDetectTheme ?? true
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// ===== CONFIGURATION METHODS =====
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get current configuration
|
|
86
|
-
*/
|
|
87
|
-
getConfig(): LoggerConfig {
|
|
88
|
-
return { ...this.config };
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Sets the global prefix for all log messages
|
|
93
|
-
*/
|
|
94
|
-
setGlobalPrefix(prefix: string): void {
|
|
95
|
-
this.config.globalPrefix = prefix;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Sets the verbosity level for filtering log output
|
|
100
|
-
*/
|
|
101
|
-
setVerbosity(level: Verbosity): void {
|
|
102
|
-
this.config.verbosity = level;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Creates a scoped logger with a specific prefix
|
|
107
|
-
*/
|
|
108
|
-
scope(prefix: string): CoreLogger {
|
|
109
|
-
const scopedLogger = new CoreLogger(this.config);
|
|
110
|
-
scopedLogger.scopedPrefix = prefix;
|
|
111
|
-
scopedLogger.handlers = [...this.handlers];
|
|
112
|
-
return scopedLogger;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Adds a custom log handler for extensibility
|
|
117
|
-
*/
|
|
118
|
-
addHandler(handler: ILogHandler): void {
|
|
119
|
-
this.handlers.push(handler);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// ===== CORE LOGGING METHODS =====
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Checks if a log level should be output based on current verbosity
|
|
126
|
-
*/
|
|
127
|
-
private shouldLog(level: LogLevel): boolean {
|
|
128
|
-
if (this.config.verbosity === 'silent') return false;
|
|
129
|
-
const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };
|
|
130
|
-
return levels[level] >= levels[this.config.verbosity];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Gets the effective prefix (global + scoped)
|
|
135
|
-
*/
|
|
136
|
-
private getEffectivePrefix(): string | undefined {
|
|
137
|
-
const parts = [this.config.globalPrefix, this.scopedPrefix].filter(Boolean);
|
|
138
|
-
return parts.length > 0 ? parts.join(':') : undefined;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Core logging method with universal formatting
|
|
143
|
-
*/
|
|
144
|
-
private log(level: LogLevel, ...args: any[]): void {
|
|
145
|
-
if (!this.shouldLog(level)) return;
|
|
146
|
-
|
|
147
|
-
const prefix = this.getEffectivePrefix();
|
|
148
|
-
const message = String(args[0] || '');
|
|
149
|
-
const stackInfo = this.config.enableStackTrace ? parseStackTrace() : null;
|
|
150
|
-
const consoleMethod = getConsoleMethod(level);
|
|
151
|
-
|
|
152
|
-
// Choose formatting based on environment and configuration
|
|
153
|
-
if (isBrowser && this.config.enableColors && supportsCSSColors()) {
|
|
154
|
-
// Browser with CSS styling
|
|
155
|
-
try {
|
|
156
|
-
const [format, ...styles] = createStyledOutput(
|
|
157
|
-
level,
|
|
158
|
-
LEVEL_STYLES,
|
|
159
|
-
prefix,
|
|
160
|
-
message,
|
|
161
|
-
stackInfo,
|
|
162
|
-
this.config.autoDetectTheme
|
|
163
|
-
);
|
|
164
|
-
console[consoleMethod](format, ...styles, ...args.slice(1));
|
|
165
|
-
} catch (error) {
|
|
166
|
-
// Fallback to plain text if CSS fails
|
|
167
|
-
const output = createPlainOutput(level, message, prefix, stackInfo);
|
|
168
|
-
console[consoleMethod](output, ...args.slice(1));
|
|
169
|
-
}
|
|
170
|
-
} else {
|
|
171
|
-
// Node.js or browser without colors - use plain text
|
|
172
|
-
const groupIndent = ' '.repeat(this.groupDepth);
|
|
173
|
-
const output = groupIndent + createPlainOutput(level, message, prefix, stackInfo);
|
|
174
|
-
console[consoleMethod](output, ...args.slice(1));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Call custom handlers with structured metadata
|
|
178
|
-
const logEntry = createLogEntry(level, message, args, prefix, stackInfo);
|
|
179
|
-
const metadata: LogMetadata = {
|
|
180
|
-
timestamp: logEntry.timestamp,
|
|
181
|
-
level,
|
|
182
|
-
prefix,
|
|
183
|
-
stackInfo: logEntry.location,
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
this.handlers.forEach(handler => {
|
|
187
|
-
try {
|
|
188
|
-
handler.handle(level, message, args, metadata);
|
|
189
|
-
} catch (error) {
|
|
190
|
-
console.error('Log handler failed:', error);
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Logs debug information (lowest priority)
|
|
197
|
-
*/
|
|
198
|
-
debug(...args: any[]): void {
|
|
199
|
-
this.log('debug', ...args);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Logs informational messages
|
|
204
|
-
*/
|
|
205
|
-
info(...args: any[]): void {
|
|
206
|
-
this.log('info', ...args);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Logs warning messages
|
|
211
|
-
*/
|
|
212
|
-
warn(...args: any[]): void {
|
|
213
|
-
this.log('warn', ...args);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Logs error messages
|
|
218
|
-
*/
|
|
219
|
-
error(...args: any[]): void {
|
|
220
|
-
this.log('error', ...args);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Logs critical errors (highest priority)
|
|
225
|
-
*/
|
|
226
|
-
critical(...args: any[]): void {
|
|
227
|
-
this.log('critical', ...args);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Logs trace information (detailed debugging)
|
|
232
|
-
*/
|
|
233
|
-
trace(...args: any[]): void {
|
|
234
|
-
this.log('debug', ...args);
|
|
235
|
-
if (this.shouldLog('debug')) {
|
|
236
|
-
console.trace(...args);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// ===== BASIC ADVANCED FEATURES =====
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Displays data in a table format
|
|
244
|
-
*/
|
|
245
|
-
table(data: any, columns?: string[]): void {
|
|
246
|
-
if (!this.shouldLog('info')) return;
|
|
247
|
-
|
|
248
|
-
const prefix = this.getEffectivePrefix();
|
|
249
|
-
const tableHeader = `[TABLE]${prefix ? ` [${prefix}]` : ''}:`;
|
|
250
|
-
|
|
251
|
-
if (isBrowser && typeof console.table === 'function') {
|
|
252
|
-
// Browser has native table support
|
|
253
|
-
console.log(tableHeader);
|
|
254
|
-
if (columns) {
|
|
255
|
-
console.table(data, columns);
|
|
256
|
-
} else {
|
|
257
|
-
console.table(data);
|
|
258
|
-
}
|
|
259
|
-
} else {
|
|
260
|
-
// Node.js or fallback - use plain text formatting
|
|
261
|
-
console.log(tableHeader);
|
|
262
|
-
const tableText = formatTablePlain(data, columns);
|
|
263
|
-
console.log(tableText);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Starts a collapsible group in the console
|
|
269
|
-
*/
|
|
270
|
-
group(label: string, collapsed: boolean = false): void {
|
|
271
|
-
const prefix = this.getEffectivePrefix();
|
|
272
|
-
const fullLabel = `${prefix ? `[${prefix}] ` : ''}${label}`;
|
|
273
|
-
|
|
274
|
-
if (isBrowser && console.group && console.groupCollapsed) {
|
|
275
|
-
// Browser supports native grouping
|
|
276
|
-
if (collapsed) {
|
|
277
|
-
console.groupCollapsed(fullLabel);
|
|
278
|
-
} else {
|
|
279
|
-
console.group(fullLabel);
|
|
280
|
-
}
|
|
281
|
-
} else {
|
|
282
|
-
// Node.js fallback - just log the group label
|
|
283
|
-
const groupStart = 'āā ' + fullLabel;
|
|
284
|
-
console.log(groupStart);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
this.groupDepth++;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Ends the current console group
|
|
292
|
-
*/
|
|
293
|
-
groupEnd(): void {
|
|
294
|
-
if (this.groupDepth > 0) {
|
|
295
|
-
if (isBrowser && console.groupEnd) {
|
|
296
|
-
console.groupEnd();
|
|
297
|
-
} else {
|
|
298
|
-
// Node.js fallback - log group end
|
|
299
|
-
const groupEnd = 'āā (end group)';
|
|
300
|
-
console.log(groupEnd);
|
|
301
|
-
}
|
|
302
|
-
this.groupDepth--;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Starts a timer with the given label
|
|
308
|
-
*/
|
|
309
|
-
time(label: string): void {
|
|
310
|
-
const startTime = this.getPerformanceNow();
|
|
311
|
-
const timer: TimerEntry = {
|
|
312
|
-
label,
|
|
313
|
-
startTime,
|
|
314
|
-
};
|
|
315
|
-
this.timers.set(label, timer);
|
|
316
|
-
|
|
317
|
-
const prefix = this.getEffectivePrefix();
|
|
318
|
-
const message = `Timer started: ${label}`;
|
|
319
|
-
const output = createPlainOutput('info', message, prefix);
|
|
320
|
-
console.log(output);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Ends a timer and logs the elapsed time
|
|
325
|
-
*/
|
|
326
|
-
timeEnd(label: string): void {
|
|
327
|
-
const timer = this.timers.get(label);
|
|
328
|
-
if (!timer) {
|
|
329
|
-
this.warn(`Timer '${label}' does not exist`);
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
const elapsed = this.getPerformanceNow() - timer.startTime;
|
|
334
|
-
this.timers.delete(label);
|
|
335
|
-
|
|
336
|
-
const prefix = this.getEffectivePrefix();
|
|
337
|
-
const message = `Timer ended: ${label} - ${elapsed.toFixed(2)}ms`;
|
|
338
|
-
const output = createPlainOutput('info', message, prefix);
|
|
339
|
-
console.log(output);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Gets performance.now() or fallback for older environments
|
|
344
|
-
*/
|
|
345
|
-
private getPerformanceNow(): number {
|
|
346
|
-
if (typeof performance !== 'undefined' && performance.now) {
|
|
347
|
-
return performance.now();
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
if (isNode && process.hrtime) {
|
|
351
|
-
// Node.js high-resolution time
|
|
352
|
-
const [seconds, nanoseconds] = process.hrtime();
|
|
353
|
-
return seconds * 1000 + nanoseconds / 1000000;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// Fallback to Date.now()
|
|
357
|
-
return Date.now();
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// Create and export singleton instance for convenience
|
|
362
|
-
const coreLogger = new CoreLogger();
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Export individual methods for convenience (with proper binding)
|
|
366
|
-
*/
|
|
367
|
-
export const debug = (...args: any[]) => coreLogger.debug(...args);
|
|
368
|
-
export const info = (...args: any[]) => coreLogger.info(...args);
|
|
369
|
-
export const warn = (...args: any[]) => coreLogger.warn(...args);
|
|
370
|
-
export const error = (...args: any[]) => coreLogger.error(...args);
|
|
371
|
-
export const critical = (...args: any[]) => coreLogger.critical(...args);
|
|
372
|
-
export const trace = (...args: any[]) => coreLogger.trace(...args);
|
|
373
|
-
export const table = (data: any, columns?: string[]) => coreLogger.table(data, columns);
|
|
374
|
-
export const group = (label: string, collapsed?: boolean) => coreLogger.group(label, collapsed);
|
|
375
|
-
export const groupEnd = () => coreLogger.groupEnd();
|
|
376
|
-
export const time = (label: string) => coreLogger.time(label);
|
|
377
|
-
export const timeEnd = (label: string) => coreLogger.timeEnd(label);
|
|
378
|
-
export const setGlobalPrefix = (prefix: string) => coreLogger.setGlobalPrefix(prefix);
|
|
379
|
-
export const scope = (prefix: string) => coreLogger.scope(prefix);
|
|
380
|
-
export const setVerbosity = (level: Verbosity) => coreLogger.setVerbosity(level);
|
|
381
|
-
export const addHandler = (handler: ILogHandler) => coreLogger.addHandler(handler);
|
|
382
|
-
|
|
383
|
-
// Export the singleton as default
|
|
384
|
-
export default coreLogger;
|
|
385
|
-
|
|
386
|
-
// Re-export core types
|
|
387
|
-
export type {
|
|
388
|
-
LogLevel,
|
|
389
|
-
Verbosity,
|
|
390
|
-
LoggerConfig,
|
|
391
|
-
ILogHandler,
|
|
392
|
-
LogMetadata
|
|
393
|
-
} from './types/index.js';
|
package/src/example.ts
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Comprehensive examples and demonstrations of Better Logger
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import logger, {
|
|
6
|
-
Logger,
|
|
7
|
-
debug,
|
|
8
|
-
info,
|
|
9
|
-
warn,
|
|
10
|
-
error,
|
|
11
|
-
success,
|
|
12
|
-
critical,
|
|
13
|
-
scope,
|
|
14
|
-
setGlobalPrefix,
|
|
15
|
-
setVerbosity,
|
|
16
|
-
setTheme,
|
|
17
|
-
setBannerType,
|
|
18
|
-
showBanner,
|
|
19
|
-
logWithSVG,
|
|
20
|
-
logAnimated,
|
|
21
|
-
cli,
|
|
22
|
-
createStyle,
|
|
23
|
-
stylePresets,
|
|
24
|
-
FileLogHandler,
|
|
25
|
-
AnalyticsLogHandler
|
|
26
|
-
} from './index.js';
|
|
27
|
-
|
|
28
|
-
// Visual features demonstrations
|
|
29
|
-
export function demonstrateBanners() {
|
|
30
|
-
info('šØ Banner System Demo');
|
|
31
|
-
|
|
32
|
-
showBanner('simple');
|
|
33
|
-
setTimeout(() => showBanner('ascii'), 1000);
|
|
34
|
-
setTimeout(() => showBanner('unicode'), 2000);
|
|
35
|
-
setTimeout(() => showBanner('svg'), 3000);
|
|
36
|
-
setTimeout(() => showBanner('animated'), 4000);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function demonstrateThemes() {
|
|
40
|
-
info('š Theme System Demo');
|
|
41
|
-
|
|
42
|
-
const themes = ['default', 'dark', 'neon', 'cyberpunk', 'retro'];
|
|
43
|
-
themes.forEach((theme, index) => {
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
setTheme(theme as any);
|
|
46
|
-
info(`Theme switched to: ${theme}`);
|
|
47
|
-
}, index * 1500);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function demonstrateSVG() {
|
|
52
|
-
const logoSVG = `<svg width="100" height="50" viewBox="0 0 100 50">
|
|
53
|
-
<rect width="100" height="50" fill="#667eea"/>
|
|
54
|
-
<text x="50" y="30" font-family="Arial" font-size="12" fill="white" text-anchor="middle">LOGO</text>
|
|
55
|
-
</svg>`;
|
|
56
|
-
|
|
57
|
-
logWithSVG('š¼ļø Custom SVG Background', logoSVG, {
|
|
58
|
-
width: 300,
|
|
59
|
-
height: 60,
|
|
60
|
-
padding: '20px 100px'
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function demonstrateAnimations() {
|
|
65
|
-
logAnimated('⨠Loading animation...', 3);
|
|
66
|
-
setTimeout(() => logAnimated('š Animation complete!', 2), 3500);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function demonstrateCLI() {
|
|
70
|
-
info('š» CLI Commands Demo');
|
|
71
|
-
|
|
72
|
-
const commands = [
|
|
73
|
-
'/config theme:neon',
|
|
74
|
-
'/banner ascii',
|
|
75
|
-
'/verbose debug',
|
|
76
|
-
'/prefix DEMO'
|
|
77
|
-
];
|
|
78
|
-
|
|
79
|
-
commands.forEach((cmd, index) => {
|
|
80
|
-
setTimeout(() => {
|
|
81
|
-
info(`Executing: ${cmd}`);
|
|
82
|
-
cli(cmd);
|
|
83
|
-
}, index * 1500);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function demonstrateExports() {
|
|
88
|
-
info('š¤ Export functionality would be demonstrated here');
|
|
89
|
-
info('Note: Export features require ExportLogger from /exports module');
|
|
90
|
-
|
|
91
|
-
const sampleData = [
|
|
92
|
-
{ timestamp: new Date().toISOString(), level: 'info', message: 'Sample log 1' },
|
|
93
|
-
{ timestamp: new Date().toISOString(), level: 'error', message: 'Sample log 2' },
|
|
94
|
-
{ timestamp: new Date().toISOString(), level: 'warn', message: 'Sample log 3' }
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
logger.table(sampleData, ['timestamp', 'level', 'message']);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Core features demonstrations
|
|
101
|
-
export function demonstrateBasicLogging() {
|
|
102
|
-
setGlobalPrefix('DEMO');
|
|
103
|
-
setVerbosity('debug');
|
|
104
|
-
|
|
105
|
-
debug('š Debug information', { config: { mode: 'development' } });
|
|
106
|
-
info('ā¹ļø Application started successfully');
|
|
107
|
-
warn('ā ļø This is a warning message');
|
|
108
|
-
error('ā An error occurred', new Error('Sample error'));
|
|
109
|
-
success('ā
User authentication successful');
|
|
110
|
-
critical('š„ Critical system failure detected');
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function demonstrateTable() {
|
|
114
|
-
const userData = [
|
|
115
|
-
{ id: 1, name: 'John Doe', email: 'john@example.com', status: 'active' },
|
|
116
|
-
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'inactive' },
|
|
117
|
-
{ id: 3, name: 'Bob Johnson', email: 'bob@example.com', status: 'active' }
|
|
118
|
-
];
|
|
119
|
-
|
|
120
|
-
logger.table(userData);
|
|
121
|
-
logger.table(userData, ['name', 'email']);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function demonstrateGrouping() {
|
|
125
|
-
logger.group('š User Analysis');
|
|
126
|
-
info('Analyzing user data...');
|
|
127
|
-
|
|
128
|
-
logger.group('š Statistics', false);
|
|
129
|
-
info('Total users: 150');
|
|
130
|
-
info('Active users: 120');
|
|
131
|
-
info('New this month: 25');
|
|
132
|
-
logger.groupEnd();
|
|
133
|
-
|
|
134
|
-
logger.group('šÆ Top Users');
|
|
135
|
-
success('Premium user: Alice Johnson');
|
|
136
|
-
success('Most active: Bob Smith');
|
|
137
|
-
logger.groupEnd();
|
|
138
|
-
|
|
139
|
-
logger.groupEnd();
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function demonstrateTiming() {
|
|
143
|
-
logger.time('api-request');
|
|
144
|
-
|
|
145
|
-
info('š Making API request...');
|
|
146
|
-
|
|
147
|
-
setTimeout(() => {
|
|
148
|
-
logger.timeEnd('api-request');
|
|
149
|
-
success('ā
API request completed');
|
|
150
|
-
}, Math.random() * 2000 + 500);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function demonstrateScopedLogger() {
|
|
154
|
-
const apiLogger = scope('API');
|
|
155
|
-
const dbLogger = scope('DB');
|
|
156
|
-
const authLogger = scope('AUTH');
|
|
157
|
-
|
|
158
|
-
apiLogger.info('š Fetching user data', { endpoint: '/api/users' });
|
|
159
|
-
dbLogger.debug('š¾ Database query executed', { query: 'SELECT * FROM users LIMIT 10' });
|
|
160
|
-
authLogger.success('š User authentication successful', { userId: 12345 });
|
|
161
|
-
|
|
162
|
-
apiLogger.warn('ā ļø Rate limit approaching', { remaining: 10 });
|
|
163
|
-
dbLogger.error('ā Connection timeout', { timeout: '5s' });
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export function demonstrateTrace() {
|
|
167
|
-
function deepFunction() {
|
|
168
|
-
function deeperFunction() {
|
|
169
|
-
logger.trace('š Deep trace call with full stack');
|
|
170
|
-
}
|
|
171
|
-
deeperFunction();
|
|
172
|
-
}
|
|
173
|
-
deepFunction();
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export function demonstrateCustomStyles() {
|
|
177
|
-
const customStyle = createStyle()
|
|
178
|
-
.bg('linear-gradient(135deg, #ff6b6b 0%, #feca57 100%)')
|
|
179
|
-
.color('white')
|
|
180
|
-
.padding('12px 20px')
|
|
181
|
-
.rounded('10px')
|
|
182
|
-
.shadow('0 4px 15px rgba(0,0,0,0.3)')
|
|
183
|
-
.bold()
|
|
184
|
-
.build();
|
|
185
|
-
|
|
186
|
-
console.log('%cšØ Custom Styled Message', customStyle);
|
|
187
|
-
console.log('%cā
Success Style', stylePresets.success);
|
|
188
|
-
console.log('%cā Error Style', stylePresets.error);
|
|
189
|
-
console.log('%cā ļø Warning Style', stylePresets.warning);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Comprehensive demonstration
|
|
193
|
-
export function demonstrateAllFeatures() {
|
|
194
|
-
info('š Starting comprehensive Better Logger demonstration...');
|
|
195
|
-
|
|
196
|
-
setTimeout(() => demonstrateBanners(), 500);
|
|
197
|
-
setTimeout(() => demonstrateBasicLogging(), 6000);
|
|
198
|
-
setTimeout(() => demonstrateCustomStyles(), 8000);
|
|
199
|
-
setTimeout(() => demonstrateGrouping(), 10000);
|
|
200
|
-
setTimeout(() => demonstrateTiming(), 13000);
|
|
201
|
-
setTimeout(() => demonstrateScopedLogger(), 16000);
|
|
202
|
-
setTimeout(() => demonstrateThemes(), 18000);
|
|
203
|
-
|
|
204
|
-
setTimeout(() => {
|
|
205
|
-
success('š Demonstration complete! Check your console for all the styled outputs.');
|
|
206
|
-
}, 25000);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Auto-run basic demo on import
|
|
210
|
-
demonstrateBasicLogging();
|