UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Private::FOutputDeviceRedirectorState Struct Reference

Public Member Functions

bool HasPanicThread () const
 
bool IsPrimaryThread (const uint32 ThreadId) const
 
bool IsPanicThread (const uint32 ThreadId) const
 
bool CanLockFromThread (const uint32 ThreadId) const
 
void AddOutputDevice (FOutputDevice *OutputDevice)
 
void RemoveOutputDevice (FOutputDevice *OutputDevice)
 
bool TryStartThread ()
 
bool TryStopThread ()
 
void ThreadLoop ()
 
void ConditionalFlushBufferedItems (EOutputDeviceRedirectorFlushOptions Options)
 
void FlushBufferedItems ()
 
template<typename VisitorType >
void FlushBufferedItemsTo (VisitorType &&Visitor)
 
uint64 CreateFence ()
 
void WaitFence (uint64 Index)
 
template<typename OutputDevicesType , typename FunctionType , typename... ArgTypes>
FORCEINLINE void BroadcastTo (const uint32 ThreadId, const OutputDevicesType &OutputDevices, const TBitArray< TInlineAllocator< 1 > > &CanBeUsedOnPanicThread, FunctionType &&Function, ArgTypes &&... Args)
 
FORCENOINLINE void EnableBacklog (bool bEnable)
 
FORCENOINLINE void AddToBacklog (const FLogRecord &Record)
 
FORCENOINLINE void AddToBacklog (const TCHAR *Data, ELogVerbosity::Type Verbosity, const FName &Category, double Time)
 
FORCENOINLINE void SerializeBacklog (TNotNull< FOutputDevice * > OutputDevice)
 
template<typename VisitorType >
UE_AUTORTFM_NOAUTORTFM void FlushBufferedItemsTo (VisitorType &&Visitor)
 

Public Attributes

FRWLock OutputDevicesLock
 
std::atomic< uint32OutputDevicesLockState = 0
 
uint8 OutputDevicesLockPadding [CalculateRedirectorCacheLinePadding(sizeof(OutputDevicesLock)+sizeof(OutputDevicesLockState))] {}
 
TConsumeAllMpmcQueue< FOutputDeviceItem, FOutputDeviceLinearAllocatorBufferedItems
 
TArray< FOutputDevice * > BufferedOutputDevices
 
TArray< FOutputDevice * > UnbufferedOutputDevices
 
TArray< FBufferedLineBacklogLines
 
FRWLock BacklogLock
 
std::atomic< uint32SerializeBacklogCount = 0
 
FThread Thread
 
FRWLock ThreadLock
 
FEventCount ThreadIdleEvent
 
FEventCount ThreadWakeEvent
 
FEventCount FenceCompleteEvent
 
std::atomic< uint64FenceCreateIndex = 0
 
std::atomic< uint64FenceCompleteIndex = 0
 
std::atomic< uint32LockedThreadId = MAX_uint32
 
std::atomic< uint32PrimaryThreadId = FPlatformTLS::GetCurrentThreadId()
 
std::atomic< uint32PanicThreadId = MAX_uint32
 
std::atomic< boolbThreadStarted = false
 
bool bEnableBacklog = !IS_PROGRAM
 
TBitArray< TInlineAllocator< 1 > > BufferedOutputDevicesCanBeUsedOnPanicThread
 
TBitArray< TInlineAllocator< 1 > > UnbufferedOutputDevicesCanBeUsedOnPanicThread
 

Member Function Documentation

◆ AddOutputDevice()

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::AddOutputDevice ( FOutputDevice OutputDevice)

◆ AddToBacklog() [1/2]

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::AddToBacklog ( const FLogRecord Record)

◆ AddToBacklog() [2/2]

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::AddToBacklog ( const TCHAR Data,
ELogVerbosity::Type  Verbosity,
const FName Category,
double  Time 
)

◆ BroadcastTo()

template<typename OutputDevicesType , typename FunctionType , typename... ArgTypes>
FORCEINLINE void UE::Private::FOutputDeviceRedirectorState::BroadcastTo ( const uint32  ThreadId,
const OutputDevicesType OutputDevices,
const TBitArray< TInlineAllocator< 1 > > &  CanBeUsedOnPanicThread,
FunctionType &&  Function,
ArgTypes &&...  Args 
)
inline

◆ CanLockFromThread()

bool UE::Private::FOutputDeviceRedirectorState::CanLockFromThread ( const uint32  ThreadId) const
inline

◆ ConditionalFlushBufferedItems()

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::ConditionalFlushBufferedItems ( EOutputDeviceRedirectorFlushOptions  Options)

◆ CreateFence()

UE_AUTORTFM_NOAUTORTFM uint64 UE::Private::FOutputDeviceRedirectorState::CreateFence ( )

◆ EnableBacklog()

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::EnableBacklog ( bool  bEnable)

◆ FlushBufferedItems()

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::FlushBufferedItems ( )

◆ FlushBufferedItemsTo() [1/2]

template<typename VisitorType >
void UE::Private::FOutputDeviceRedirectorState::FlushBufferedItemsTo ( VisitorType &&  Visitor)

◆ FlushBufferedItemsTo() [2/2]

template<typename VisitorType >
UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::FlushBufferedItemsTo ( VisitorType &&  Visitor)

◆ HasPanicThread()

bool UE::Private::FOutputDeviceRedirectorState::HasPanicThread ( ) const
inline

◆ IsPanicThread()

bool UE::Private::FOutputDeviceRedirectorState::IsPanicThread ( const uint32  ThreadId) const
inline

◆ IsPrimaryThread()

bool UE::Private::FOutputDeviceRedirectorState::IsPrimaryThread ( const uint32  ThreadId) const
inline

◆ RemoveOutputDevice()

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::RemoveOutputDevice ( FOutputDevice OutputDevice)

◆ SerializeBacklog()

void UE::Private::FOutputDeviceRedirectorState::SerializeBacklog ( TNotNull< FOutputDevice * >  OutputDevice)

◆ ThreadLoop()

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::ThreadLoop ( )

◆ TryStartThread()

UE_AUTORTFM_NOAUTORTFM bool UE::Private::FOutputDeviceRedirectorState::TryStartThread ( )

◆ TryStopThread()

UE_AUTORTFM_NOAUTORTFM bool UE::Private::FOutputDeviceRedirectorState::TryStopThread ( )

◆ WaitFence()

UE_AUTORTFM_NOAUTORTFM void UE::Private::FOutputDeviceRedirectorState::WaitFence ( uint64  Index)

Member Data Documentation

◆ BacklogLines

TArray<FBufferedLine> UE::Private::FOutputDeviceRedirectorState::BacklogLines

A queue of lines logged before the editor added its output device.

◆ BacklogLock

FRWLock UE::Private::FOutputDeviceRedirectorState::BacklogLock

◆ bEnableBacklog

bool UE::Private::FOutputDeviceRedirectorState::bEnableBacklog = !IS_PROGRAM

Whether the backlog is enabled.

◆ bThreadStarted

std::atomic<bool> UE::Private::FOutputDeviceRedirectorState::bThreadStarted = false

Whether a dedicated primary thread has been started.

◆ BufferedItems

TConsumeAllMpmcQueue<FOutputDeviceItem, FOutputDeviceLinearAllocator> UE::Private::FOutputDeviceRedirectorState::BufferedItems

A queue of items logged by non-primary threads.

◆ BufferedOutputDevices

TArray<FOutputDevice*> UE::Private::FOutputDeviceRedirectorState::BufferedOutputDevices

Array of output devices to redirect to from the primary thread.

◆ BufferedOutputDevicesCanBeUsedOnPanicThread

TBitArray<TInlineAllocator<1> > UE::Private::FOutputDeviceRedirectorState::BufferedOutputDevicesCanBeUsedOnPanicThread

Whether the output device at the corresponding index can be used on the panic thread.

◆ FenceCompleteEvent

FEventCount UE::Private::FOutputDeviceRedirectorState::FenceCompleteEvent

An event to wake threads waiting on fences.

◆ FenceCompleteIndex

std::atomic<uint64> UE::Private::FOutputDeviceRedirectorState::FenceCompleteIndex = 0

The index of the last completed fence. Never decreases even when fences complete out of order.

◆ FenceCreateIndex

std::atomic<uint64> UE::Private::FOutputDeviceRedirectorState::FenceCreateIndex = 0

The index of the last created fence.

◆ LockedThreadId

std::atomic<uint32> UE::Private::FOutputDeviceRedirectorState::LockedThreadId = MAX_uint32

The ID of the thread holding the primary lock.

◆ OutputDevicesLock

FRWLock UE::Private::FOutputDeviceRedirectorState::OutputDevicesLock

A custom lock to guard access to both buffered and unbuffered output devices.

◆ OutputDevicesLockPadding

uint8 UE::Private::FOutputDeviceRedirectorState::OutputDevicesLockPadding[CalculateRedirectorCacheLinePadding(sizeof(OutputDevicesLock)+sizeof(OutputDevicesLockState))] {}

◆ OutputDevicesLockState

std::atomic<uint32> UE::Private::FOutputDeviceRedirectorState::OutputDevicesLockState = 0

◆ PanicThreadId

std::atomic<uint32> UE::Private::FOutputDeviceRedirectorState::PanicThreadId = MAX_uint32

The ID of the panic thread, which is only set by Panic().

◆ PrimaryThreadId

std::atomic<uint32> UE::Private::FOutputDeviceRedirectorState::PrimaryThreadId = FPlatformTLS::GetCurrentThreadId()

The ID of the primary logging thread. Logging from other threads will be buffered for processing by the primary thread.

◆ SerializeBacklogCount

std::atomic<uint32> UE::Private::FOutputDeviceRedirectorState::SerializeBacklogCount = 0

◆ Thread

FThread UE::Private::FOutputDeviceRedirectorState::Thread

An optional dedicated primary thread for logging to buffered output devices.

◆ ThreadIdleEvent

FEventCount UE::Private::FOutputDeviceRedirectorState::ThreadIdleEvent

An event that is notified when the dedicated primary thread is idle.

◆ ThreadLock

FRWLock UE::Private::FOutputDeviceRedirectorState::ThreadLock

A lock to synchronize access to the thread.

◆ ThreadWakeEvent

FEventCount UE::Private::FOutputDeviceRedirectorState::ThreadWakeEvent

An event to wake the dedicated primary thread to process buffered items.

◆ UnbufferedOutputDevices

TArray<FOutputDevice*> UE::Private::FOutputDeviceRedirectorState::UnbufferedOutputDevices

Array of output devices to redirect to from the calling thread.

◆ UnbufferedOutputDevicesCanBeUsedOnPanicThread

TBitArray<TInlineAllocator<1> > UE::Private::FOutputDeviceRedirectorState::UnbufferedOutputDevicesCanBeUsedOnPanicThread

The documentation for this struct was generated from the following file: