cleanup: wrap console.log calls behind window.DASHCADDY_DEBUG flag

Wrapped 22 console.log calls across 6 files with a debug() helper
that only logs when window.DASHCADDY_DEBUG is true in the browser console.

Files:
- tour-manager.js: 10 calls
- theme-adapter.js: 4 calls
- keyboard-shortcuts.js: 4 calls
- tooltip-definitions.js: 2 calls
- progress-tracker.js: 1 call
- live-events.js: 1 call

console.error and console.warn calls preserved — those indicate
real issues worth seeing in production.
This commit is contained in:
Krystie
2026-05-14 00:48:51 -07:00
parent 8ecae81703
commit 5d404f5733
6 changed files with 42 additions and 22 deletions
+8 -4
View File
@@ -7,6 +7,10 @@
(function(window) {
'use strict';
const debug = (...args) => {
if (window.DASHCADDY_DEBUG) { console.log(...args); }
};
/**
* Theme configuration mapping for Driver.js
* Maps dashboard themes to Driver.js styling
@@ -170,7 +174,7 @@
attributeFilter: ['class']
});
console.log('[ThemeAdapter] Theme change listener initialized');
debug('[ThemeAdapter] Theme change listener initialized');
}
/**
@@ -180,7 +184,7 @@
* @param {string} oldTheme - Old theme name
*/
_notifyThemeChange(newTheme, oldTheme) {
console.log(`[ThemeAdapter] Theme changed: ${oldTheme}${newTheme}`);
debug(`[ThemeAdapter] Theme changed: ${oldTheme}${newTheme}`);
this.themeChangeCallbacks.forEach(callback => {
try {
@@ -207,7 +211,7 @@
// Note: Driver.js v1.0+ uses CSS variables, so we inject a style element
this._injectDriverStyles(themeConfig);
console.log('[ThemeAdapter] Theme applied to driver:', this.currentTheme);
debug('[ThemeAdapter] Theme applied to driver:', this.currentTheme);
}
/**
@@ -302,6 +306,6 @@
// Export to global scope
window.ThemeAdapter = ThemeAdapter;
console.log('[ThemeAdapter] Module loaded');
debug('[ThemeAdapter] Module loaded');
})(window);