mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-12 11:08:14 +00:00
[host] windows: move the service log to the temp directory
Often this log is provided instead of the actual host log, as this log is largely useless for debugging this moves it to the temp directory out of view of the user.
This commit is contained in:
@@ -78,7 +78,13 @@ void doLogReal(const char * fmt, ...)
|
||||
static void setupLogging(void)
|
||||
{
|
||||
char logFilePath[MAX_PATH];
|
||||
if (!PathCombineA(logFilePath, getSystemLogDirectory(), LOG_NAME))
|
||||
|
||||
// remove the old service log file if it exists
|
||||
if (PathCombineA(logFilePath, getSystemLogDirectory(), LOG_NAME))
|
||||
unlink(logFilePath);
|
||||
|
||||
// open the service file in the temp directory as we usually do not need it
|
||||
if (!PathCombineA(logFilePath, getSystemTempDirectory(), LOG_NAME))
|
||||
strcpy(logFilePath, LOG_NAME);
|
||||
service.logFile = fopen(logFilePath, "a+");
|
||||
setbuf(service.logFile, NULL);
|
||||
|
||||
Reference in New Issue
Block a user