$logProvider debug logging default off from AngularJS 1.5
23.5K reputation · 26 Sept 2022, 19:32 UTC
AngularJS 1.5 changed the default for $logProvider.enableDebugLogging from true to false. In 1.4 and earlier, $log.debug calls from Angular internals and third-party modules were emitted by default, which increased console volume. From 1.5 onward the flag defaults to false and debug output is suppressed unless explicitly enabled in the module config phase.
The configuration is set with $logProvider.enableDebugLogging during config and cannot be changed at runtime without reinitializing the application. The change reduces notification noise but also removes diagnostic output that some modules emit via $log.debug.
For a codebase transitioning from 1.4 to 1.5+, the goal is to keep useful alerts visible in development and testing while avoiding console noise in production. The config-phase restriction and reliance of third-party code on $log.debug create an unresolved decision about visibility versus noise.
Under what conditions is enableDebugLogging considered appropriate for non-production builds? How does the config-phase-only restriction affect visibility of diagnostics from dynamically loaded modules? Can disabling debug logging obscure non-debug warnings from third-party modules that use $log.debug for operational messages?