From f9ec32b2552e4623f0adf635db06d89af000e749 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 24 Jan 2021 17:29:50 -0500 Subject: [PATCH] [host] service: disable buffering on the log file Before this change, the log is buffered, so if the host application exits for any reason, it usually would not show up in the log file immediately, and the service has to be restarted for the logs to be flushed. This commit disables the buffering so that any log entries shows up immediately. --- host/platform/Windows/src/service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/host/platform/Windows/src/service.c b/host/platform/Windows/src/service.c index 18f773c1..34cfee43 100644 --- a/host/platform/Windows/src/service.c +++ b/host/platform/Windows/src/service.c @@ -118,6 +118,7 @@ static void setupLogging(void) char * logFilePath = malloc(len + 1); sprintf(logFilePath, "%slooking-glass-host-service.txt", tempPath); service.logFile = fopen(logFilePath, "a+"); + setbuf(service.logFile, NULL); doLog("Startup\n"); }