#include <FLogWriter.h>
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
33 {
34 UE_LOG(LogTemp, Error, TEXT("Failed to open log file at: %s"), *LogFilePath);
35 }
36}
다음을 참조함 : LogFile.
◆ ~FLogWriter()
| FLogWriter::~FLogWriter |
( |
| ) |
|
◆ Get()
◆ WriteLog()
| void FLogWriter::WriteLog |
( |
const FString & |
Message | ) |
|
FLogWriter.cpp 파일의 48 번째 라인에서 정의되었습니다.
49{
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());
61}
다음을 참조함 : LogFile.
◆ LogFile
| FArchive* FLogWriter::LogFile = nullptr |
|
private |
이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: