29 lines
1.4 KiB
JavaScript
29 lines
1.4 KiB
JavaScript
// Simple test to verify logging reduction
|
|
// This would be run in a browser console to test the changes
|
|
|
|
console.log("=== Testing Logging Reduction ===");
|
|
|
|
// Test 1: Check AudioService default log level
|
|
console.log("Test 1: AudioService should default to ERROR level");
|
|
const audioService = require('./web/src/services/audioService.ts');
|
|
console.log("Expected: LogLevel.ERROR, Actual:", audioService.getInstance().logLevel);
|
|
|
|
// Test 2: Verify DEBUG logs are suppressed
|
|
console.log("\nTest 2: DEBUG logs should be suppressed");
|
|
audioService.getInstance().log(audioService.LogLevel.DEBUG, "This DEBUG message should NOT appear");
|
|
|
|
// Test 3: Verify INFO logs are suppressed
|
|
console.log("\nTest 3: INFO logs should be suppressed");
|
|
audioService.getInstance().log(audioService.LogLevel.INFO, "This INFO message should NOT appear");
|
|
|
|
// Test 4: Verify ERROR logs still work
|
|
console.log("\nTest 4: ERROR logs should still appear");
|
|
audioService.getInstance().log(audioService.LogLevel.ERROR, "This ERROR message SHOULD appear");
|
|
|
|
// Test 5: Check that useWaveform has no debug logs
|
|
console.log("\nTest 5: useWaveform should have minimal console.debug calls");
|
|
const useWaveformCode = require('fs').readFileSync('./web/src/hooks/useWaveform.ts', 'utf8');
|
|
const debugCount = (useWaveformCode.match(/console\.debug/g) || []).length;
|
|
console.log("console.debug calls in useWaveform:", debugCount, "(should be 0)");
|
|
|
|
console.log("\n=== Logging Reduction Test Complete ==="); |