fix: résolution device IDs et correction sox capture args
Corrections pour le routing audio carte son → LiveKit : **Fixes audio backend** - AudioBridgeManager : extraction des device IDs depuis config.audio.device - AudioBridge : ajout résolution device ID → device name pour CoreAudio/sox - CoreAudioBackend : correction index args sox capture (args[2] au lieu de args[1]) **Résultat** - ✅ Sox capture fonctionne : lit depuis "Microphone MacBook Pro" - ✅ Audio capturé et envoyé vers routing - ❌ Sox playback se ferme après 0.2s (problème persistant à corriger) **Autres modifications** - Logging centralisé (Logger.js) - IP corrigée : 192.168.0.146 - Suppression système channels[] legacy dans groupes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Logger.js
|
||||
* Système de logging centralisé avec niveaux configurables
|
||||
*/
|
||||
|
||||
const LOG_LEVELS = {
|
||||
ERROR: 0,
|
||||
WARN: 1,
|
||||
INFO: 2,
|
||||
DEBUG: 3,
|
||||
TRACE: 4
|
||||
};
|
||||
|
||||
class Logger {
|
||||
constructor(category = 'default', level = 'INFO') {
|
||||
this.category = category;
|
||||
this.level = LOG_LEVELS[level] ?? LOG_LEVELS.INFO;
|
||||
}
|
||||
|
||||
setLevel(level) {
|
||||
this.level = LOG_LEVELS[level] ?? LOG_LEVELS.INFO;
|
||||
}
|
||||
|
||||
error(message, ...args) {
|
||||
if (this.level >= LOG_LEVELS.ERROR) {
|
||||
console.error(`[${this.category}] ❌`, message, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
warn(message, ...args) {
|
||||
if (this.level >= LOG_LEVELS.WARN) {
|
||||
console.warn(`[${this.category}] ⚠️ `, message, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
info(message, ...args) {
|
||||
if (this.level >= LOG_LEVELS.INFO) {
|
||||
console.log(`[${this.category}] ℹ️ `, message, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
success(message, ...args) {
|
||||
if (this.level >= LOG_LEVELS.INFO) {
|
||||
console.log(`[${this.category}] ✓`, message, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
debug(message, ...args) {
|
||||
if (this.level >= LOG_LEVELS.DEBUG) {
|
||||
console.log(`[${this.category}] 🔍`, message, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
trace(message, ...args) {
|
||||
if (this.level >= LOG_LEVELS.TRACE) {
|
||||
console.log(`[${this.category}] 🔬`, message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configuration globale depuis env ou config
|
||||
const globalLevel = process.env.LOG_LEVEL || 'INFO';
|
||||
|
||||
// Loggers par catégorie
|
||||
const loggers = new Map();
|
||||
|
||||
export function getLogger(category) {
|
||||
if (!loggers.has(category)) {
|
||||
loggers.set(category, new Logger(category, globalLevel));
|
||||
}
|
||||
return loggers.get(category);
|
||||
}
|
||||
|
||||
export function setGlobalLogLevel(level) {
|
||||
loggers.forEach(logger => logger.setLevel(level));
|
||||
}
|
||||
|
||||
export default { getLogger, setGlobalLogLevel };
|
||||
Reference in New Issue
Block a user