[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 2021-01-24 17:29:50 -05:00 committed by Geoffrey McRae
parent 8caf951c41
commit f9ec32b255

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");
}