KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
FLogWriter 클래스 참조

#include <FLogWriter.h>

+ FLogWriter에 대한 협력 다이어그램:

Public 멤버 함수

 FLogWriter ()
 
 ~FLogWriter ()
 
void WriteLog (const FString &Message)
 

정적 Public 멤버 함수

static FLogWriterGet ()
 

Private 속성

FArchive * LogFile = nullptr
 

상세한 설명

FLogWriter.h 파일의 11 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ FLogWriter()

FLogWriter::FLogWriter ( )

FLogWriter.cpp 파일의 19 번째 라인에서 정의되었습니다.

20{
21 if (!FPlatformProcess::SupportsMultithreading())
22 {
23 return;
24 }
25
26 const FString TimeString = FDateTime::Now().ToString(TEXT("%Y-%m-%d_%H-%M-%S"));
27 const FString LogFileName = FString::Printf(TEXT("CoffeeLog-%s.log"), *TimeString);
28 const FString LogFilePath = FPaths::ProjectLogDir() / LogFileName;
29
30 LogFile = IFileManager::Get().CreateFileWriter(*LogFilePath, FILEWRITE_Append);
31
32 if (!LogFile)
33 {
34 UE_LOG(LogTemp, Error, TEXT("Failed to open log file at: %s"), *LogFilePath);
35 }
36}
FArchive * LogFile
Definition FLogWriter.h:22

다음을 참조함 : LogFile.

◆ ~FLogWriter()

FLogWriter::~FLogWriter ( )

FLogWriter.cpp 파일의 38 번째 라인에서 정의되었습니다.

39{
40 if (LogFile)
41 {
42 LogFile->Close();
43 delete LogFile;
44 LogFile = nullptr;
45 }
46}

다음을 참조함 : LogFile.

멤버 함수 문서화

◆ Get()

FLogWriter & FLogWriter::Get ( )
static

FLogWriter.cpp 파일의 13 번째 라인에서 정의되었습니다.

14{
15 static FLogWriter Instance;
16 return Instance;
17}

다음에 의해서 참조됨 : GetLogWriter().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ WriteLog()

void FLogWriter::WriteLog ( const FString &  Message)

FLogWriter.cpp 파일의 48 번째 라인에서 정의되었습니다.

49{
50 if (!LogFile)
51 {
52 return;
53 }
54
55 const FString Timestamp = FDateTime::Now().ToString(TEXT("%Y-%m-%d %H:%M:%S"));
56 const FString LogLine = FString::Printf(TEXT("[%s] %s\n"), *Timestamp, *Message);
57
58 FTCHARToUTF8 Converter(*LogLine);
59 LogFile->Serialize(const_cast<void*>(static_cast<const void*>(Converter.Get())), Converter.Length());
60 LogFile->Flush(); // TODO: Optionalize or buffer later
61}

다음을 참조함 : LogFile.

멤버 데이터 문서화

◆ LogFile

FArchive* FLogWriter::LogFile = nullptr
private

FLogWriter.h 파일의 22 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : FLogWriter(), ~FLogWriter(), WriteLog().


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: