feat(server): add DEBUG_LOGGING environment variable to suppress verbose console output

This commit is contained in:
Koala
2026-06-03 11:57:58 +02:00
parent fa3341cc8e
commit ad33720053
12 changed files with 42 additions and 26 deletions
+4
View File
@@ -116,6 +116,10 @@ const peerToSocket = new Map(); // peerId -> socketId (Global lookup)
const roomCreationLocks = new Map(); // roomId -> Promise (prevents race on room creation)
function log(type, message, details = '') {
const debugLogging = process.env.DEBUG_LOGGING === '1';
const isVerbose = type === 'CONN' || type === 'ROOM' || type === 'DEDUPE' || type === 'CORS';
if (!debugLogging && isVerbose) return;
const timestamp = new Date().toISOString();
console.log(`[${timestamp}] [${type}] ${message}`, details);
}