diff --git a/package.json b/package.json index 40e429cc..e1cd5e45 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "dependencies": { "express": "^5.0.0", "fluent-ffmpeg": "^2.1.2", - "log4js": "^6.9.1", "qrcode-terminal": "^0.12.0", "silk-wasm": "^3.6.1", "ws": "^8.18.0" diff --git a/src/common/log.ts b/src/common/log.ts index 69ae9afb..159d98d8 100644 --- a/src/common/log.ts +++ b/src/common/log.ts @@ -110,14 +110,15 @@ export class LogWrapper { _log(level: LogLevel, ...args: any[]) { const message = this.formatMsg(args); - if (this.consoleLogEnabled) { + if (this.consoleLogEnabled && this.fileLogEnabled) { this.logger.log(level, message); - } - if (this.fileLogEnabled) { + } else if (this.consoleLogEnabled) { + this.logger.log(level, message); + } else if (this.fileLogEnabled) { this.logger.log(level, message.replace(/\x1B[@-_][0-?]*[ -/]*[@-~]/g, '')); } } - + log(...args: any[]) { this._log(LogLevel.INFO, ...args); }