UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Trace Namespace Reference

Namespaces

namespace  Private
 
namespace  Protocol0
 
namespace  Protocol1
 
namespace  Protocol2
 
namespace  Protocol3
 
namespace  Protocol4
 
namespace  Protocol5
 
namespace  Protocol6
 
namespace  Protocol7
 

Classes

class  FChannel
 
struct  FChannelInfo
 
struct  FInitializeDesc
 
struct  FMessageEvent
 
struct  FSendFlags
 
struct  FStatistics
 
struct  TEventRef
 

Typedefs

typedef TEventRef< uint8FEventRef8
 
typedef TEventRef< uint16FEventRef16
 
typedef TEventRef< uint32FEventRef32
 
typedef TEventRef< uint64FEventRef64
 
using OnMessageFunc = void(const FMessageEvent &)
 
using OnConnectFunc = void(void)
 
using OnUpdateFunc = void(void)
 
using OnScopeBeginFunc = void(const ANSICHAR *)
 
using OnScopeEndFunc = void(void)
 
typedef uint32 FChannelId
 
typedef voidAllocFunc(SIZE_T Size, uint32 Alignment)
 
typedef void FreeFunc(void *Ptr, SIZE_T Size)
 
typedef void ChannelIterFunc(const ANSICHAR *Name, bool State, void *User)
 
typedef bool ChannelIterCallback(const FChannelInfo &Info, void *)
 
typedef bool IoWriteFunc(UPTRINT Handle, const void *Data, uint32 Size)
 
typedef void IoCloseFunc(UPTRINT Handle)
 

Enumerations

enum  ETransport : uint8 {
  _Unused = 0 , Raw = 1 , Packet = 2 , TidPacket = 3 ,
  TidPacketSync = 4 , Active = TidPacketSync
}
 
enum  ETransportTid : uint32 {
  Events = 0 , Internal = 1 , Importants = Internal , Bias ,
  End = 0x3ffe , Sync = 0x3fff
}
 
enum  AnsiString
 
enum  WideString
 
enum class  EMessageType : uint8 {
  Reserved = 0 , Log , Info = Log , Display ,
  WarningStart = 0x04 , ErrorStart = 0x10 , WriteError , ReadError ,
  ConnectError , ListenError , EstablishError , FileOpenError ,
  WriterError , CompressionError , FatalStart = 0x40 , GenericFatal ,
  OOMFatal
}
 

Functions

template<typename IdType >
TEventRef< IdType > MakeEventRef (IdType InId, uint32 InTypeId)
 
UE_TRACE_API void SetMemoryHooks (AllocFunc Alloc, FreeFunc Free) UE_TRACE_IMPL()
 
UE_TRACE_API void SetMessageCallback (OnMessageFunc *MessageFunc) UE_TRACE_IMPL()
 
UE_TRACE_API void SetUpdateCallback (OnUpdateFunc *UpdateFunc) UE_TRACE_IMPL()
 
UE_TRACE_API void Initialize (const FInitializeDesc &Desc) UE_TRACE_IMPL()
 
UE_TRACE_API void StartWorkerThread () UE_TRACE_IMPL()
 
UE_TRACE_API void Exit () UE_TRACE_IMPL()
 
UE_TRACE_API void Shutdown () UE_TRACE_IMPL()
 
UE_TRACE_API void Panic () UE_TRACE_IMPL()
 
UE_TRACE_API void Update () UE_TRACE_IMPL()
 
UE_TRACE_API void GetStatistics (FStatistics &Out) UE_TRACE_IMPL()
 
UE_TRACE_API bool SendTo (const TCHAR *Host, uint32 Port=0, uint16 Flags=FSendFlags::None) UE_TRACE_IMPL(false)
 
UE_TRACE_API bool WriteTo (const TCHAR *Path, uint16 Flags=FSendFlags::None) UE_TRACE_IMPL(false)
 
UE_TRACE_API bool RelayTo (UPTRINT InHandle, IoWriteFunc WriteFunc, IoCloseFunc CloseFunc, uint16 Flags=FSendFlags::None) UE_TRACE_IMPL(false)
 
UE_TRACE_API bool WriteSnapshotTo (const TCHAR *Path) UE_TRACE_IMPL(false)
 
UE_TRACE_API bool SendSnapshotTo (const TCHAR *Host, uint32 Port) UE_TRACE_IMPL(false)
 
UE_TRACE_API bool IsTracing () UE_TRACE_IMPL(false)
 
UE_TRACE_API bool IsTracingTo (uint32(&OutSessionGuid)[4], uint32(&OutTraceGuid)[4]) UE_TRACE_IMPL(false)
 
UE_TRACE_API bool Stop () UE_TRACE_IMPL(false)
 
UE_TRACE_API bool IsChannel (const TCHAR *ChannelName) UE_TRACE_IMPL(false)
 
UE_TRACE_API bool ToggleChannel (const TCHAR *ChannelName, bool bEnabled) UE_TRACE_IMPL(false)
 
UE_TRACE_API void EnumerateChannels (ChannelIterFunc IterFunc, void *User) UE_TRACE_IMPL()
 
UE_TRACE_API void EnumerateChannels (ChannelIterCallback IterFunc, void *User) UE_TRACE_IMPL()
 
UE_TRACE_API void ThreadRegister (const TCHAR *Name, uint32 SystemId, int32 SortHint) UE_TRACE_IMPL()
 
UE_TRACE_API void ThreadGroupBegin (const TCHAR *Name) UE_TRACE_IMPL()
 
UE_TRACE_API void ThreadGroupEnd () UE_TRACE_IMPL()
 
UE_TRACE_API FChannelFindChannel (const TCHAR *ChannelName) UE_TRACE_IMPL(nullptr)
 
UE_TRACE_API FChannelFindChannel (FChannelId ChannelId) UE_TRACE_IMPL(nullptr)
 

Typedef Documentation

◆ AllocFunc

typedef void * UE::Trace::AllocFunc(SIZE_T Size, uint32 Alignment)

Allocate memory callback

Parameters
SizeSize to allocate
AlignmentAlignment of memory
Returns
Pointer to allocated memory

◆ ChannelIterCallback

typedef bool UE::Trace::ChannelIterCallback(const FChannelInfo &Info, void *)

The callback provides information about a channel and a user provided pointer.

Parameters
InfoInformation about the channel
UserUser data passed to the callback
Returns
Returning false from the callback will stop the enumeration

◆ ChannelIterFunc

typedef void UE::Trace::ChannelIterFunc(const ANSICHAR *Name, bool State, void *User)

The callback provides information about a channel and a user provided pointer.

Parameters
NameName of channel
StateEnabled state of channel
UserUser data passed to the callback

◆ FChannelId

◆ FEventRef16

◆ FEventRef32

◆ FEventRef64

◆ FEventRef8

◆ FreeFunc

typedef void UE::Trace::FreeFunc(void *Ptr, SIZE_T Size)

Free memory callback

Parameters
PtrMemory to free
SizeSize of memory to free

◆ IoCloseFunc

typedef void UE::Trace::IoCloseFunc(UPTRINT Handle)

User defined close callback.

Parameters
HandleUser defined handle passed to the function

◆ IoWriteFunc

typedef bool UE::Trace::IoWriteFunc(UPTRINT Handle, const void *Data, uint32 Size)

User defined write callback.

Parameters
HandleUser defined handle passed to the function
DataPointer to data to write
SizeSize of data to write
Returns
True if all data could be written correctly, false if error occurred.

◆ OnConnectFunc

◆ OnMessageFunc

◆ OnScopeBeginFunc

◆ OnScopeEndFunc

◆ OnUpdateFunc

Enumeration Type Documentation

◆ AnsiString

◆ EMessageType

Enumerator
Reserved 
Log 
Info 
Display 
WarningStart 
ErrorStart 
WriteError 
ReadError 
ConnectError 
ListenError 
EstablishError 
FileOpenError 
WriterError 
CompressionError 
FatalStart 
GenericFatal 
OOMFatal 

◆ ETransport

Enumerator
_Unused 
Raw 
Packet 
TidPacket 
TidPacketSync 
Active 

◆ ETransportTid

Enumerator
Events 
Internal 
Importants 
Bias 
End 
Sync 

◆ WideString

Function Documentation

◆ EnumerateChannels() [1/2]

UE_TRACE_API void UE::Trace::EnumerateChannels ( ChannelIterCallback  IterFunc,
void User 
)

Enumerates registered channels.

Parameters
IterFuncFunction to call for each channel
UserOptional pointer to user data to pass to callback

◆ EnumerateChannels() [2/2]

UE_TRACE_API void UE::Trace::EnumerateChannels ( ChannelIterFunc  IterFunc,
void User 
)

Enumerates registered channels.

Parameters
IterFuncFunction to call for each channel
UserOptional pointer to user data to pass to callback

◆ Exit()

UE_TRACE_API void UE::Trace::Exit ( )

Call when application is exiting. Notifies TraceLog that the worker thread can dissapear at any time and clears block pool limits. Tracing is still possible.

◆ FindChannel() [1/2]

UE_TRACE_API FChannel * UE::Trace::FindChannel ( const TCHAR ChannelName)

Attempts to find the corresponding channel object given a channel name.

Parameters
ChannelNameName to search for
Returns
Pointer to channel object, or null if no channel matching the name have been registered

◆ FindChannel() [2/2]

UE_TRACE_API FChannel * UE::Trace::FindChannel ( FChannelId  ChannelId)

Attempts to find the corresponding channel object given a channel id.

Parameters
ChannelIdId to search for
Returns
Pointer to channel object, or null if no channel with matching id have been registered

◆ GetStatistics()

UE_TRACE_API void UE::Trace::GetStatistics ( FStatistics Out)

Fetches tracked telemetry from the library.

Parameters
OutPointer to struct where telemetry values will be written to.

◆ Initialize()

UE_TRACE_API void UE::Trace::Initialize ( const FInitializeDesc Desc)

Initalize TraceLog library.

Parameters
DescInitalization options

◆ IsChannel()

UE_TRACE_API bool UE::Trace::IsChannel ( const TCHAR ChannelName)

Checks if a string is valid channel name.

Parameters
ChanelNameString to check
Returns
True if there is a registered channel object with the same name.

◆ IsTracing()

UE_TRACE_API bool UE::Trace::IsTracing ( )

Checks if TraceLog currently has an output. Note that trace events can still be recorded and saved in tail buffers regardless if an output is active.

Returns
True if an output is active, false if not

◆ IsTracingTo()

UE_TRACE_API bool UE::Trace::IsTracingTo ( uint32(&)  OutSessionGuid[4],
uint32(&)  OutTraceGuid[4] 
)

Checks if TraceLog currently has an output and return session and trace GUIDs of active trace stream. Note that trace events can still be recorded and saved in tail buffers regardless if an output is active.

Parameters
OutSessionGuidIf output is active current session GUID will be written, otherwise it will be unchanged
OutTraceGuidIf output is active current trace GUID will be written, otherwise it will be unchanged
Returns
True if an output is active, false if not

◆ MakeEventRef()

template<typename IdType >
TEventRef< IdType > UE::Trace::MakeEventRef ( IdType  InId,
uint32  InTypeId 
)

◆ Panic()

UE_TRACE_API void UE::Trace::Panic ( )

Notifies TraceLog about a critical failure. Disables all tracing by muting all channels.

◆ RelayTo()

UE_TRACE_API bool UE::Trace::RelayTo ( UPTRINT  InHandle,
IoWriteFunc  WriteFunc,
IoCloseFunc  CloseFunc,
uint16  Flags = FSendFlags::None 
)

Setup TraceLog to output to user defined callback, to take effect next update. Will fail if another pending output has been queued.

Parameters
WriteFuncFunction to call when writing data
CloseFuncFunction to call when output is closed
FlagsOptions for the connection
Returns
True if successful, false otherwise

◆ SendSnapshotTo()

UE_TRACE_API bool UE::Trace::SendSnapshotTo ( const TCHAR Host,
uint32  Port 
)

Immediately write contents of tail buffers and important events to a remote host.

Parameters
HostTarget hostname or ip
PortTarget port

◆ SendTo()

UE_TRACE_API bool UE::Trace::SendTo ( const TCHAR Host,
uint32  Port = 0,
uint16  Flags = FSendFlags::None 
)

Setup TraceLog to output to remote host using a socket connection, to take effect next update. Will fail if another pending output has been queued or the host is unreachable.

Parameters
HostTarget hostname or ip
PortTarget port
FlagsOptions for the connection
Returns
True on successful connection to host, false otherwise

◆ SetMemoryHooks()

UE_TRACE_API void UE::Trace::SetMemoryHooks ( AllocFunc  Alloc,
FreeFunc  Free 
)

Set optional allocation and free methods to use. If not set TraceLog will fall back to default platform allocation methods.

Parameters
AllocCallback for allocations
FreeCallback for free

◆ SetMessageCallback()

UE_TRACE_API void UE::Trace::SetMessageCallback ( OnMessageFunc MessageFunc)

Set optional callback to use for critical messages. See OnMessageFunc for details.

Parameters
MessageFuncFunction to call for critical messages

◆ SetUpdateCallback()

UE_TRACE_API void UE::Trace::SetUpdateCallback ( OnUpdateFunc UpdateFunc)

Set optional on update callbacks. If set issued after every update and once after initalization.

Parameters
UpdateFuncFunction to call after every update

◆ Shutdown()

UE_TRACE_API void UE::Trace::Shutdown ( )

Shuts down the library completely and frees resources. After this tracing will not be possible.

◆ StartWorkerThread()

UE_TRACE_API void UE::Trace::StartWorkerThread ( )

Manually start worker thread if library is initalized without worker thread.

◆ Stop()

UE_TRACE_API bool UE::Trace::Stop ( )

Stops current output if any is active.This will fail there is no active output or if there is already a queued output to be started.

Returns
True if any output was stopped, false if no output was active or there is a queued output to be started.

◆ ThreadGroupBegin()

UE_TRACE_API void UE::Trace::ThreadGroupBegin ( const TCHAR Name)

Define a group of threads with similar use. Any thread created within this call and /ref ThreadGroupEnd will be grouped together.

Parameters
NameDisplay name of group

◆ ThreadGroupEnd()

UE_TRACE_API void UE::Trace::ThreadGroupEnd ( )

End a group of threads with similar use. See /ref ThreadGroupBegin.

◆ ThreadRegister()

UE_TRACE_API void UE::Trace::ThreadRegister ( const TCHAR Name,
uint32  SystemId,
int32  SortHint 
)

Register a new thread in Trace. This is a requirement before tracing anything from the thrad.

Parameters
NameDisplay name of thread
SystemIdPlatform specific thread id
SortHintSuggestion on how to order thread in presentation

◆ ToggleChannel()

UE_TRACE_API bool UE::Trace::ToggleChannel ( const TCHAR ChannelName,
bool  bEnabled 
)

Toggles channel to control output of events.

Parameters
ChanelNameName of channel to control
bEnabledSet if channel should be enabled or disabled
Returns
Final channel state. If the channel name was not found return false.

◆ Update()

UE_TRACE_API void UE::Trace::Update ( )

Manually update TraceLog if no worker thread is running. Only one thread (including the worker thread) is able to enter the update method at any point.

◆ WriteSnapshotTo()

UE_TRACE_API bool UE::Trace::WriteSnapshotTo ( const TCHAR Path)

Immediately write contents of tail buffers and important events to a new or existing file.

Parameters
PathTarget path

◆ WriteTo()

UE_TRACE_API bool UE::Trace::WriteTo ( const TCHAR Path,
uint16  Flags = FSendFlags::None 
)

Setup TraceLog to output to a new or existing file, to take effect next update. Will fail if another pending output has been queued or if the file location is not writeable.

Parameters
PathTarget path
FlagsOptions for the connection
Returns
True if the file could be opened or created correctly, false otherwise