Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FOutputDeviceRedirector Class Referencefinal

#include <OutputDeviceRedirector.h>

+ Inheritance diagram for FOutputDeviceRedirector:
+ Collaboration diagram for FOutputDeviceRedirector:

Public Types

typedef TArray< FOutputDevice *, TInlineAllocator< 16 > > TLocalOutputDevicesArray
 

Public Member Functions

 FOutputDeviceRedirector ()
 
void AddOutputDevice (FOutputDevice *OutputDevice)
 
void RemoveOutputDevice (FOutputDevice *OutputDevice)
 
bool IsRedirectingTo (FOutputDevice *OutputDevice)
 
void FlushThreadedLogs (EOutputDeviceRedirectorFlushOptions Options=EOutputDeviceRedirectorFlushOptions::None)
 
 UE_DEPRECATED (5.1, "Use Panic() when the caller is handling a crash, otherwise use FlushThreadedLogs().") void PanicFlushThreadedLogs()
 
void SerializeBacklog (FOutputDevice *OutputDevice)
 
void EnableBacklog (bool bEnable)
 
void SetCurrentThreadAsPrimaryThread ()
 
void SetCurrentThreadAsMasterThread ()
 
bool TryStartDedicatedPrimaryThread ()
 
void SerializeRecord (const UE::FLogRecord &Record) final
 
void Serialize (const TCHAR *Data, ELogVerbosity::Type Verbosity, const FName &Category, const double Time) final
 
void Serialize (const TCHAR *Data, ELogVerbosity::Type Verbosity, const FName &Category) final
 
void RedirectLog (const FName &Category, ELogVerbosity::Type Verbosity, const TCHAR *Data)
 
void RedirectLog (const FLazyName &Category, ELogVerbosity::Type Verbosity, const TCHAR *Data)
 
void Flush () final
 
void Panic ()
 
void TearDown () final
 
bool IsBacklogEnabled () const
 
- Public Member Functions inherited from FOutputDevice
 FOutputDevice ()
 
 FOutputDevice (FOutputDevice &&)=default
 
 FOutputDevice (const FOutputDevice &)=default
 
FOutputDeviceoperator= (FOutputDevice &&)=default
 
FOutputDeviceoperator= (const FOutputDevice &)=default
 
virtual ~FOutputDevice ()=default
 
virtual void Serialize (const TCHAR *V, ELogVerbosity::Type Verbosity, const FName &Category)=0
 
virtual void Serialize (const TCHAR *V, ELogVerbosity::Type Verbosity, const FName &Category, const double Time)
 
void SetSuppressEventTag (bool bInSuppressEventTag)
 
FORCEINLINE bool GetSuppressEventTag () const
 
void SetAutoEmitLineTerminator (bool bInAutoEmitLineTerminator)
 
FORCEINLINE bool GetAutoEmitLineTerminator () const
 
virtual void Dump (class FArchive &Ar)
 
virtual bool IsMemoryOnly () const
 
virtual bool CanBeUsedOnAnyThread () const
 
virtual bool CanBeUsedOnMultipleThreads () const
 
virtual bool CanBeUsedOnPanicThread () const
 
void Log (const TCHAR *S)
 
void Log (ELogVerbosity::Type Verbosity, const TCHAR *S)
 
void Log (const FName &Category, ELogVerbosity::Type Verbosity, const TCHAR *Str)
 
void Log (const FString &S)
 
void Log (const FText &S)
 
void Log (ELogVerbosity::Type Verbosity, const FString &S)
 
void Log (const FName &Category, ELogVerbosity::Type Verbosity, const FString &S)
 
template<typename FmtType >
void Logf (const FmtType &Fmt)
 
template<typename FmtType , typename... Types>
FORCEINLINE void Logf (const FmtType &Fmt, Types... Args)
 
template<typename FmtType , typename... Types>
FORCEINLINE void Logf (ELogVerbosity::Type Verbosity, const FmtType &Fmt, Types... Args)
 
template<typename FmtType , typename... Types>
FORCEINLINE void CategorizedLogf (const FName &Category, ELogVerbosity::Type Verbosity, const FmtType &Fmt, Types... Args)
 

Static Public Member Functions

static FOutputDeviceRedirectorGet ()
 

Private Attributes

TPimplPtr< UE::Private::FOutputDeviceRedirectorState > State
 

Additional Inherited Members

- Protected Attributes inherited from FOutputDevice
bool bSuppressEventTag
 
bool bAutoEmitLineTerminator
 

Detailed Description

Class used for output redirection to allow logs to show in multiple output devices.

Definition at line 71 of file OutputDeviceRedirector.h.

Member Typedef Documentation

◆ TLocalOutputDevicesArray

Constructor & Destructor Documentation

◆ FOutputDeviceRedirector()

FOutputDeviceRedirector::FOutputDeviceRedirector ( )

Initialization constructor.

Member Function Documentation

◆ AddOutputDevice()

void FOutputDeviceRedirector::AddOutputDevice ( FOutputDevice * OutputDevice)

Adds an output device to the chain of redirections.

Parameters
OutputDeviceOutput device to add.

◆ EnableBacklog()

void FOutputDeviceRedirector::EnableBacklog ( bool bEnable)

Enables or disables the backlog.

Parameters
bEnableStarts saving a backlog if true, disables and discards any backlog if false.

◆ Flush()

void FOutputDeviceRedirector::Flush ( )
finalvirtual

Passes on the flush request to all current output devices.

Reimplemented from FOutputDevice.

◆ FlushThreadedLogs()

void FOutputDeviceRedirector::FlushThreadedLogs ( EOutputDeviceRedirectorFlushOptions Options = EOutputDeviceRedirectorFlushOptions::None)

Flushes lines buffered by secondary threads.

◆ Get()

static FOutputDeviceRedirector * FOutputDeviceRedirector::Get ( )
static

Get the GLog singleton.

◆ IsBacklogEnabled()

bool FOutputDeviceRedirector::IsBacklogEnabled ( ) const

Determine if the backlog is enabled.

◆ IsRedirectingTo()

bool FOutputDeviceRedirector::IsRedirectingTo ( FOutputDevice * OutputDevice)

Returns whether an output device is in the list of redirections.

Parameters
OutputDeviceOutput device to check the list against.
Returns
true if messages are currently redirected to the the passed in output device, false otherwise.

◆ Panic()

void FOutputDeviceRedirector::Panic ( )

Attempts to set the calling thread as the panic thread and enable panic mode.

Only one thread can be the panic thread. Subsequent calls from other threads are ignored. Only redirects logs to panic-safe output devices from this point forward. Makes the calling thread the primary log thread as well. Flushes buffered logs to panic-safe output devices. Flushes panic-safe output devices.

+ Here is the caller graph for this function:

◆ RedirectLog() [1/2]

void FOutputDeviceRedirector::RedirectLog ( const FLazyName & Category,
ELogVerbosity::Type Verbosity,
const TCHAR * Data )

◆ RedirectLog() [2/2]

void FOutputDeviceRedirector::RedirectLog ( const FName & Category,
ELogVerbosity::Type Verbosity,
const TCHAR * Data )

Same as Serialize().

◆ RemoveOutputDevice()

void FOutputDeviceRedirector::RemoveOutputDevice ( FOutputDevice * OutputDevice)

Removes an output device from the chain of redirections.

Parameters
OutputDeviceOutput device to remove.

◆ Serialize() [1/2]

void FOutputDeviceRedirector::Serialize ( const TCHAR * Data,
ELogVerbosity::Type Verbosity,
const FName & Category )
final

Serializes the passed in data via all current output devices.

Parameters
DataText to log.
EventEvent name used for suppression purposes.

◆ Serialize() [2/2]

void FOutputDeviceRedirector::Serialize ( const TCHAR * Data,
ELogVerbosity::Type Verbosity,
const FName & Category,
const double Time )
final

Serializes the passed in data via all current output devices.

Parameters
DataText to log.
EventEvent name used for suppression purposes.

◆ SerializeBacklog()

void FOutputDeviceRedirector::SerializeBacklog ( FOutputDevice * OutputDevice)

Serializes the current backlog to the specified output device.

Parameters
OutputDeviceOutput device that will receive the current backlog.

◆ SerializeRecord()

void FOutputDeviceRedirector::SerializeRecord ( const UE::FLogRecord & Record)
finalvirtual

Serializes the log record via all current output devices.

The format string pointed to by the record must remain valid indefinitely.

Reimplemented from FOutputDevice.

◆ SetCurrentThreadAsMasterThread()

void FOutputDeviceRedirector::SetCurrentThreadAsMasterThread ( )
inline

Definition at line 135 of file OutputDeviceRedirector.h.

+ Here is the call graph for this function:

◆ SetCurrentThreadAsPrimaryThread()

void FOutputDeviceRedirector::SetCurrentThreadAsPrimaryThread ( )

Sets the current thread to be the thread that redirects logs to buffered output devices.

The current thread can redirect to buffered output devices without buffering, and becomes responsible for flushing buffered logs from secondary threads. Logs from secondary threads will not be redirected unless the current thread periodically flushes threaded logs.

+ Here is the caller graph for this function:

◆ TearDown()

void FOutputDeviceRedirector::TearDown ( )
finalvirtual

Closes output device and cleans up.

This can't happen in the destructor as we might have to call "delete" which cannot be done for static/global objects.

Reimplemented from FOutputDevice.

◆ TryStartDedicatedPrimaryThread()

bool FOutputDeviceRedirector::TryStartDedicatedPrimaryThread ( )

Starts a dedicated primary thread that redirects logs to buffered output devices.

A thread will not be started for certain configurations or platforms, or when threading is disabled.

Returns
true if a dedicated primary logging thread is running, false otherwise.

◆ UE_DEPRECATED()

FOutputDeviceRedirector::UE_DEPRECATED ( 5. 1,
"Use Panic() when the caller is handling a crash,
otherwise use FlushThreadedLogs()."  )
inline

See Panic.

Definition at line 109 of file OutputDeviceRedirector.h.

+ Here is the call graph for this function:

Member Data Documentation

◆ State

TPimplPtr<UE::Private::FOutputDeviceRedirectorState> FOutputDeviceRedirector::State
private

Definition at line 200 of file OutputDeviceRedirector.h.


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