5#include "Containers/Array.h"
7#include "HAL/CriticalSection.h"
8#include "HAL/Runnable.h"
9#include "HAL/ThreadSafeCounter.h"
10#include "Logging/LogVerbosity.h"
11#include "Misc/OutputDevice.h"
12#include "Misc/ScopeLock.h"
13#include "Misc/SingleThreadRunnable.h"
14#include "Serialization/Archive.h"
15#include "Templates/Atomic.h"
16#include "Templates/Function.h"
17#include "Templates/UniquePtr.h"
18#include "UObject/NameTypes.h"
24#define BACKUP_LOG_FILENAME_POSTFIX TEXT("-backup-")
27
28
29
84 virtual void Serialize(
void* InData, int64 Length)
override;
99 virtual void Tick()
override;
111
112
117
118
119
120
121
122
123
124
125
126 FOutputDeviceFile(
const TCHAR* InFilename =
nullptr,
bool bDisableBackup =
false,
bool bAppendIfExists =
false,
bool bCreateWriterLazily =
true, TFunction<
void(
const TCHAR*)> FileOpenedCallback =
TFunction<
void(
const TCHAR*)>());
129
130
131
139
140
141
142
146
147
148
191 struct FCategoryInclusionInternal;
FWindowsCriticalSection FCriticalSection
void FlushArchiveAndResetTimer()
FAsyncWriter(FArchive &InAr, FAsyncWriter::EThreadNameOption NameOption=FAsyncWriter::EThreadNameOption::FileName)
FCriticalSection BufferPosCritical
FCriticalSection RunCritical
double LastArchiveFlushTime
virtual FSingleThreadRunnable * GetSingleThreadInterface() override
TAtomic< int32 > BufferEndPos
volatile FRunnableThread * Thread
FThreadSafeCounter StopTaskCounter
TAtomic< int32 > BufferStartPos
FThreadSafeCounter WantsArchiveFlush
void SerializeBufferToArchive()
virtual void Serialize(void *InData, int64 Length) override
FThreadSafeCounter SerializeRequestCounter
virtual void Tick() override
TFunction< void(const TCHAR *) OnFileOpenedFn)
virtual void Serialize(const TCHAR *Data, ELogVerbosity::Type Verbosity, const class FName &Category, const double Time) override
FOutputDeviceFile(const TCHAR *InFilename=nullptr, bool bDisableBackup=false, bool bAppendIfExists=false, bool bCreateWriterLazily=true, TFunction< void(const TCHAR *)> FileOpenedCallback=TFunction< void(const TCHAR *)>())
virtual bool CanBeUsedOnPanicThread() const override
void WriteByteOrderMarkToArchive(EByteOrderMark ByteOrderMark)
const TCHAR * GetFilename() const
static bool IsBackupCopy(const TCHAR *Filename)
void WriteRaw(const TCHAR *C)
FAsyncWriter * AsyncWriter
bool CreateWriter(uint32 MaxAttempts=32)
void IncludeCategory(const class FName &InCategoryName)
void SetFilename(const TCHAR *InFilename)
static void CreateBackupCopy(const TCHAR *Filename)
TUniquePtr< FCategoryInclusionInternal > CategoryInclusionInternal
virtual bool CanBeUsedOnAnyThread() const override
virtual void Serialize(const TCHAR *Data, ELogVerbosity::Type Verbosity, const class FName &Category) override