[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.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-01-25 09:35:03 +11:00
1 parent 8caf951c41
commit f9ec32b255
1 file changed
+1
+1
View File
@@ -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");
}