From b4186052df27dc16382b3d15bfe34975d7d2b99a Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 18 Jan 2024 16:04:22 +0100 Subject: [PATCH] Add printing stack trace even when not using log file --- Source/Engine/Platform/Base/PlatformBase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Platform/Base/PlatformBase.cpp b/Source/Engine/Platform/Base/PlatformBase.cpp index 9a6b1b9dc..2c9f5bb5c 100644 --- a/Source/Engine/Platform/Base/PlatformBase.cpp +++ b/Source/Engine/Platform/Base/PlatformBase.cpp @@ -269,7 +269,6 @@ void PlatformBase::Fatal(const Char* msg, void* context) Globals::ExitCode = -1; // Collect crash info (platform-dependant implementation that might collect stack trace and/or create memory dump) - if (Log::Logger::LogFilePath.HasChars()) { // Log separation for crash info Log::Logger::WriteFloor(); @@ -320,7 +319,9 @@ void PlatformBase::Fatal(const Char* msg, void* context) LOG(Error, "Process Used Physical Memory: {0}", Utilities::BytesToText(processMemoryStats.UsedPhysicalMemory)); LOG(Error, "Process Used Virtual Memory: {0}", Utilities::BytesToText(processMemoryStats.UsedVirtualMemory)); } - + } + if (Log::Logger::LogFilePath.HasChars()) + { // Create separate folder with crash info const String crashDataFolder = String(StringUtils::GetDirectoryName(Log::Logger::LogFilePath)) / TEXT("Crash_") + StringUtils::GetFileNameWithoutExtension(Log::Logger::LogFilePath).Substring(4); FileSystem::CreateDirectory(crashDataFolder);