diff --git a/src/common/logger.ts b/src/common/logger.ts index 825fa2493b..ca975871b8 100644 --- a/src/common/logger.ts +++ b/src/common/logger.ts @@ -59,24 +59,24 @@ if (ipcMain) { ), }) ); + + if (!isTestEnv) { + transports.push( + new winston.transports.File({ + handleExceptions: false, + level: logLevel, + filename: "lens.log", + dirname: getPath("logs"), + maxsize: 16 * 1024, + maxFiles: 16, + tailable: true, + }) + ); + } } else { transports.push(new BrowserConsole()); } -if (!isTestEnv) { - transports.push( - new winston.transports.File({ - handleExceptions: false, - level: logLevel, - filename: "lens.log", - dirname: getPath("logs"), - maxsize: 16 * 1024, - maxFiles: 16, - tailable: true, - }) - ); -} - export default winston.createLogger({ format: format.simple(), transports,