Skip to content

Commit cbad44a

Browse files
committed
[Net, Win] Disable session logging on Windows.
TSAR Server uses signal processing to flush session log on termination. However, kill() on Windows does not emulate signals, it terminates application in unknown way instead. So, we always disable session logging on Windows OS.
1 parent ead4a49 commit cbad44a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/project.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,12 @@ export class ProjectEngine {
331331
reject(new Error(log.Error.serverNotFound.replace('{0}', 'tsar-server')));
332332
return;
333333
}
334-
let args = userConfig.get('advanced.log.enabled') !== true ? [] :
334+
// TSAR Server uses signal processing to flush session log on termination.
335+
// However, kill() on Windows does not emulate signals, it terminates
336+
// application in unknown way instead. So, we always disable session logging
337+
// on Windows OS.
338+
let args = userConfig.get('advanced.log.enabled') !== true ||
339+
process.platform.match(/^win/i) ? [] :
335340
[ path.join(prjDir, log.Project.session.replace('{0}', `${Date.now()}`)) ];
336341
log.Log.logs[0].write(log.Message.serverFound.replace('{0}', pathToServer));
337342
server = child_process.spawn(pathToServer, args,

0 commit comments

Comments
 (0)