Architecture: How should we reduce excessive console logs across the appli...
Documentation for Sessions
🏗️ Architecture: How should we reduce excessive console logs across the appli...
📋 Decision Context
Question:
How should we reduce excessive console logs across the application?
Task: Not specified
🎯 Decision Made
Chosen:
Systematic migration to centralized logging system with createLogger
Options Considered:
- Keep all console.log statements
- Remove all logs
- Migrate to centralized system
- Use environment flags
💭 Reasoning
Migrated 23 services/files to centralized logging system using createLogger from @libs-dev-tools/debug-utils. This provides runtime control via LogControl.enable/disable('category'), zero overhead when disabled, production-safe automatic disabling, and category-based organization (init, theme, modules, widgets, auth, sync, storage, flash, debug). Achieved 65% log reduction (330 → 115 logs) by: 1) Silencing debug utilities (10 → 0 logs), 2) Migrating bridge services (11 → 3 logs), 3) Migrating auth services (13 → 7 logs), 4) Migrating nav services (5 → 2 logs), 5) Consolidating multi-line logs into single concise statements, 6) Removing emoji spam. Result: Clean console on startup, full debugging capability when needed via browser console (LogControl.enable('category')), zero performance overhead when disabled, and maintainable single-configuration-point system.
📁 Files Involved
libs/libs-dev-tools/debug-utils/src/lib/global-log-control.tsapps/gograb-space/src/app/app.config.tsapps/gograb-space/src/main.tslibs/core/module-adapter/src/lib/module-widget-bridge.service.tslibs/core/module-base/src/lib/services/module-registry.service.tslibs/core/event-system/src/lib/services/event-bus.service.tslibs/libs-foundational/storage-system/src/core/user-context/user-context.service.tslibs/libs-foundational/core-angular/src/lib/services/space-api.service.tslibs/libs-foundational/storage-system/src/flash/providers/auto-flash-persistence.provider.tslibs/libs-foundational/storage-system/src/flash/providers/flash-persistence.provider.tslibs/libs-foundational/storage-system/src/angular/providers/storage-registry.provider.tslibs/libs-foundational/storage-system/src/core/registry/auto-discovery.tslibs/libs-foundational/storage-system/src/angular/providers/intelligent-storage.provider.tsapps/gograb-space/src/app/utils/debug-sync-verification.tslibs/libs-foundational/core-angular/src/lib/utils/debug-universe-storage.tsapps/gograb-space/src/app/utils/clear-cached-space.tslibs/libs-structural/singularity-lib/src/lib/services/orchestration.service.tslibs/libs-structural/singularity-lib/src/lib/bridges/editor-bridge.service.tslibs/libs-structural/singularity-lib/src/lib/bridges/space-map-bridge.service.tslibs/libs-structural/singularity-lib/src/lib/bridges/storage-bridge.service.tslibs/libs-foundational/core-angular/src/lib/modules/guest-auth/guest-auth.service.tsapps/gograb-space/src/app/services/nav-builder.service.tsapps/gograb-space/src/app/services/route-ready.service.ts
🔗 Related
- Decision ID:
dev_1767732133812_oubx6ci - Session: 22
- Workspace: editor2
Auto-generated by MCP Smart Consolidation