UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MetadataTrace.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
5#include "Trace/Config.h"
6#include "Trace/Trace.h"
7
8# if !defined(UE_TRACE_METADATA_ENABLED)
9 #if !IS_PROGRAM
10 #define UE_TRACE_METADATA_ENABLED UE_TRACE_ENABLED
11 #else
12 #define UE_TRACE_METADATA_ENABLED 0
13 #endif
14#endif //defined(UE_TRACE_METADATA_ENABLED
15
16#if UE_TRACE_METADATA_ENABLED
17
18// Only needed when enabled
19#include "Trace/Trace.inl"
20
21namespace UE { namespace Trace { class FChannel; } }
22
27
30
34
38
40{
41public:
42 CORE_API static uint32 SaveStack();
43};
44
45// For now just forward to the event definition macros.
46#define UE_TRACE_METADATA_EVENT_BEGIN_EXTERN(ScopeName, ...) UE_TRACE_EVENT_BEGIN_EXTERN(Metadata, ScopeName, ##__VA_ARGS__)
47#define UE_TRACE_METADATA_EVENT_DEFINE(ScopeName) UE_TRACE_EVENT_DEFINE(Metadata, ScopeName)
48#define UE_TRACE_METADATA_EVENT_BEGIN(ScopeName, ...) UE_TRACE_EVENT_BEGIN(Metadata, ScopeName, ##__VA_ARGS__)
49#define UE_TRACE_METADATA_EVENT_FIELD(Type, Name) UE_TRACE_EVENT_FIELD(Type, Name)
50#define UE_TRACE_METADATA_EVENT_REFERENCE_FIELD(RefLogger, RefEventName, Name) UE_TRACE_EVENT_REFERENCE_FIELD(RefLogger, RefEventName, Name)
51#define UE_TRACE_METADATA_EVENT_END() UE_TRACE_EVENT_END()
52
56#define UE_TRACE_METADATA_SCOPE(ScopeName, ChannelExpr) \
57 UE_TRACE_LOG_SCOPED(Metadata, ScopeName, MetadataChannel | ChannelExpr)
58
64#define UE_TRACE_METADATA_CLEAR_SCOPE() \
65 UE_TRACE_LOG_SCOPED(MetadataStack, ClearScope, MetadataChannel)
66
71#define UE_TRACE_METADATA_SAVE_STACK() \
72 FMetadataTrace::SaveStack();
73
78{
79public:
82private:
84 UE::Trace::Private::FScopedLogScope Inner;
85};
86
91#define UE_TRACE_METADATA_RESTORE_SCOPE(SavedMetadataIdentifier) \
92 FMetadataRestoreScope PREPROCESSOR_JOIN(__MetadataRestoreScope, __LINE__)(SavedMetadataIdentifier);
93
94#else // UE_TRACE_METADATA_ENABLED
95
96#define UE_TRACE_METADATA_EVENT_BEGIN_EXTERN(ScopeName, ...)
97#define UE_TRACE_METADATA_EVENT_DEFINE(ScopeName)
98#define UE_TRACE_METADATA_EVENT_BEGIN(ScopeName, ...)
99#define UE_TRACE_METADATA_EVENT_FIELD(Type, Name)
100#define UE_TRACE_METADATA_EVENT_END()
101#define UE_TRACE_METADATA_SCOPE(ScopeName, ChannelExpr)
102
103#define UE_TRACE_METADATA_CLEAR_SCOPE()
104#define UE_TRACE_METADATA_SAVE_STACK() 0
105#define UE_TRACE_METADATA_RESTORE_SCOPE(SavedMetadataIdentifier)
106
107#endif // UE_TRACE_METADATA_ENABLED
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_TRACE_CHANNEL_EXTERN(ChannelName,...)
Definition Trace.h:448
#define UE_TRACE_EVENT_BEGIN_EXTERN(LoggerName, EventName,...)
Definition Trace.h:435
#define UE_TRACE_EVENT_END()
Definition Trace.h:438
#define UE_TRACE_EVENT_FIELD(FieldType, FieldName)
Definition Trace.h:436
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AdvancedWidgetsModule.cpp:13