UNPKG

win-stream-audio

Version:

🎧 Stream Windows system audio to Android devices over WiFi with professional audio controls, EQ, pitch shifting, and effects

76 lines (61 loc) â€ĸ 2.03 kB
/** * AudioPilot - Logger Module * Handles mission log display and debug history */ class Logger { constructor(outputElement) { this.outputElement = outputElement; this.debugHistory = []; this.maxDebugLines = 20; this.historyEnabled = false; this.log('AudioPilot System Online - Awaiting Commands...'); } log(message) { const timestamp = new Date().toLocaleTimeString(); const logEntry = `[${timestamp}] ${message}`; if (this.historyEnabled) { this.debugHistory.push(logEntry); if (this.debugHistory.length > this.maxDebugLines) { this.debugHistory.shift(); } this.outputElement.textContent = this.debugHistory.join('\n'); } else { this.outputElement.textContent = logEntry; } // Auto-scroll to bottom this.outputElement.scrollTop = this.outputElement.scrollHeight; // Also log to console for debugging console.log(logEntry); } enableHistory() { this.historyEnabled = true; this.log('Debug history enabled - logs will accumulate'); } disableHistory() { this.historyEnabled = false; this.debugHistory = []; this.log('Debug history disabled - showing current only'); } clear() { this.debugHistory = []; this.outputElement.textContent = 'AudioPilot System Online - Awaiting Commands...'; } error(message) { this.log('❌ ERROR: ' + message); console.error(message); } warn(message) { this.log('âš ī¸ WARNING: ' + message); console.warn(message); } info(message) { this.log('â„šī¸ INFO: ' + message); console.info(message); } success(message) { this.log('✅ SUCCESS: ' + message); console.log(message); } } // Export for use in other modules window.Logger = Logger;