[host] windows: log to stderr that logs will continue in file

This prevents users from posting the stderr as if it's the only output.
This commit is contained in:
Quantum 2022-11-24 19:38:01 -05:00 committed by Geoffrey McRae
parent f519904c38
commit e1ebde3cd2

View File

@ -526,7 +526,13 @@ bool app_init(void)
// redirect stderr to a file // redirect stderr to a file
if (logFile && strcmp(logFile, "stderr") != 0) if (logFile && strcmp(logFile, "stderr") != 0)
freopen(logFile, "a", stderr); {
DEBUG_INFO("Logs will be written to: %s", logFile);
DEBUG_INFO("Please see there for any further information");
if (!freopen(logFile, "a", stderr))
DEBUG_WARN("Failed to open log file, will log to stderr");
}
// always flush stderr // always flush stderr
setbuf(stderr, NULL); setbuf(stderr, NULL);