From 9fd2994b7392a60dbdb4b1cf84042f9348a23a1a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 14 Apr 2024 21:18:47 +1000 Subject: [PATCH] Log: Fix crash with >1 instance + file log --- src/common/log.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index f830f05fb..78c37f1c8 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -427,9 +427,10 @@ void Log::SetFileOutputParams(bool enabled, const char* filename, bool timestamp if (enabled) { s_file_handle.reset(FileSystem::OpenCFile(filename, "wb")); - if (!s_file_handle) + if (!s_file_handle) [[unlikely]] { - Log::Writef("Log", __FUNCTION__, LOGLEVEL_ERROR, "Failed to open log file '%s'", filename); + ExecuteCallbacks("Log", __FUNCTION__, LOGLEVEL_ERROR, + TinyString::from_format("Failed to open log file '{}'", filename), lock); return; }