From e1ebde3cd219fd3e89097bc22dd8766e443cb605 Mon Sep 17 00:00:00 2001 From: Quantum Date: Thu, 24 Nov 2022 19:38:01 -0500 Subject: [PATCH] [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. --- host/platform/Windows/src/platform.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/host/platform/Windows/src/platform.c b/host/platform/Windows/src/platform.c index a734f112..9b843272 100644 --- a/host/platform/Windows/src/platform.c +++ b/host/platform/Windows/src/platform.c @@ -526,7 +526,13 @@ bool app_init(void) // redirect stderr to a file 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 setbuf(stderr, NULL);