Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
HierarchicalLogArchive.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/UnrealString.h"
6#include "CoreMinimal.h"
7#include "HAL/Platform.h"
8#include "Misc/AssertionMacros.h"
9#include "Serialization/ArchiveProxy.h"
10
11class FArchive;
12
14{
15public:
17
19 {
21 ~FIndentScope() { check(Ar->Indentation); Ar->Indentation--; }
23 };
24
25 void Print(const TCHAR* InLine)
26 {
27 WriteLine(InLine, false);
28 }
29
31 {
32 WriteLine(InLine, true);
33 return FIndentScope(this);
34 }
35
36 template <typename FmtType, typename... Types>
37 void Printf(const FmtType& Fmt, Types... Args)
38 {
39 WriteLine(FString::Printf(Fmt, Args...), false);
40 }
41
42 template <typename FmtType, typename... Types>
43 UE_NODISCARD FIndentScope PrintfIndent(const FmtType& Fmt, Types... Args)
44 {
45 WriteLine(FString::Printf(Fmt, Args...), true);
46 return FIndentScope(this);
47 }
48
49private:
50 void WriteLine(const FString& InLine, bool bIndent = false);
51
53};
54
55#if NO_LOGGING
56#define UE_SCOPED_INDENT_LOG_ARCHIVE(Code)
57#else
58#define UE_SCOPED_INDENT_LOG_ARCHIVE(Code)
59 FHierarchicalLogArchive::FIndentScope BODY_MACRO_COMBINE(Scoped,Indent,_,__LINE__) = Code
60#endif
#define check(expr)
#define NO_LOGGING
Definition Build.h:326
#define UE_NODISCARD
Definition Platform.h:660
FIndentScope(FHierarchicalLogArchive *InAr)
FHierarchicalLogArchive(FArchive &InInnerArchive)
void WriteLine(const FString &InLine, bool bIndent=false)
void Printf(const FmtType &Fmt, Types... Args)
UE_NODISCARD FIndentScope PrintfIndent(const FmtType &Fmt, Types... Args)
UE_NODISCARD FIndentScope PrintIndent(const TCHAR *InLine)
void Print(const TCHAR *InLine)