-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
595bf09
commit 6b72925
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2024 Sentry. All Rights Reserved. | ||
|
||
#include "SentryLogUtils.h" | ||
|
||
#include "CoreGlobals.h" | ||
#include "GenericPlatform/GenericPlatformStackWalk.h" | ||
#include "HAL/UnrealMemory.h" | ||
#include "Misc/OutputDeviceRedirector.h" | ||
|
||
void SentryLogUtils::LogStackTrace(const TCHAR* Heading, const ELogVerbosity::Type LogVerbosity, int FramesToSkip) | ||
{ | ||
#if !NO_LOGGING | ||
const SIZE_T StackTraceSize = 65535; | ||
ANSICHAR* StackTrace = (ANSICHAR*)FMemory::SystemMalloc(StackTraceSize); | ||
|
||
{ | ||
StackTrace[0] = 0; | ||
FGenericPlatformStackWalk::StackWalkAndDumpEx(StackTrace, StackTraceSize, FramesToSkip + 1, FGenericPlatformStackWalk::EStackWalkFlags::FlagsUsedWhenHandlingEnsure); | ||
} | ||
|
||
FDebug::LogFormattedMessageWithCallstack(LogOutputDevice.GetCategoryName(), __FILE__, __LINE__, Heading, ANSI_TO_TCHAR(StackTrace), LogVerbosity); | ||
|
||
GLog->Flush(); | ||
|
||
FMemory::SystemFree(StackTrace); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) 2024 Sentry. All Rights Reserved. | ||
|
||
#pragma once | ||
|
||
#include "CoreTypes.h" | ||
#include "Logging/LogVerbosity.h" | ||
|
||
class SentryLogUtils | ||
{ | ||
public: | ||
static void LogStackTrace(const TCHAR* Heading, const ELogVerbosity::Type LogVerbosity, int FramesToSkip); | ||
}; |