FStackTraceManager

Manager for handling multiple debug stack traces on-the-fly, and allowing abstraction of stack traces, so you don't have to manually handle [FNUTStackTrace](API\Plugins\NetcodeUnitTest\FNUTStackTrace) objects (which can be complicated/bug-prone).

Windows
MacOS
Linux

References

Module

NetcodeUnitTest

Header

/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Public/NUTUtilDebug.h

Include

#include "NUTUtilDebug.h"

Syntax

class FStackTraceManager

Remarks

Manager for handling multiple debug stack traces on-the-fly, and allowing abstraction of stack traces, so you don't have to manually handle FNUTStackTrace objects (which can be complicated/bug-prone).

This is a more intuitive way of handling tracing, you just use a call to 'GTraceManager->AddTrace' wherever needed, and add calls to 'Enable'/'Disable' whenever you want to accept/ignore AddTrace calls - then 'Dump' to see the results. No messing with managing instances of above objects.

This also hooks into console commands as well, allowing it to be used throughout the engine, instead of depending on this module. See the documentation for the 'StackTrace' command in UnitTestManager.cpp.

Variables

Name Description

Protected variable

TMap< FString, ...

 

Traces

A map of active debug stack traces

Constructors

Name Description

Public function

FStackTraceManager()

Base constructor

FStackTraceManager

Destructors

Name Description

Public function

~FStackTraceManager()

Destructor

Functions

Name Description

Public function

void

 

AddTrace

(
    FString TraceName,
    bool bLogAdd,
    bool bDump,
    bool bStartDisabled
)

Adds a new stack trace, to the specified trace, optionally logging/dumping in the process

Public function

void

 

Clear

(
    FString TraceName
)

Clears the specified trace from tracking

Public function

bool

 

ContainsTrace

(
    FString TraceName
)

Whether or not a trace of this name is present

Public function

void

 

Disable

(
    FString TraceName
)

Passes on a 'Disable' call, to the specified stack trace (if it exists)

Public function

void

 

Dump

(
    FString TraceName,
    bool bKeepTraceHistory,
    bool bKeepTracking
)

Dumps accumulated stack traces, and removes from tracking (unless otherwise specified)

Public function

void

 

DumpAll

(
    bool bKeepTraceHistory,
    bool bKeepTracking
)

Dumps accumulated stack traces, for all tracked traces

Public function

void

 

Enable

(
    FString TraceName
)

Passes on an 'Enable' call, to the specified stack trace

Protected function

FNUTStackTra...

 

GetOrCreateTrace

(
    FString TraceName,
    bool* bOutNewTrace
)

Gets or creates a trace, of the specified name

Protected function

FNUTStackTra...

 

GetTrace

(
    FString TraceName
)

Gets the trace of the specified name, or NULL if it doesn't exist

Public function

void

 

TraceAndDump

(
    FString TraceName
)

Performs a once-off stack trace, with no tracking (but if there is already a trace active with this name, respect its 'enabled' status)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss