You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Prepare for future work by breaking out logging and instance info into separate files. #rb ionut.matasaru [CL 29987825 by johan berg in ue5-main branch]
37 lines
915 B
C++
37 lines
915 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Foundation.h"
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
#define TS_LOG(Format, ...) \
|
|
do { FLogging::Log(Format "\n", ##__VA_ARGS__); } while (false)
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
class FLogging
|
|
{
|
|
public:
|
|
static void Log(const char* Format, ...);
|
|
|
|
private:
|
|
friend struct FLoggingScope;
|
|
FLogging(FPath& Path);
|
|
~FLogging();
|
|
FLogging(const FLogging&) = delete;
|
|
FLogging(FLogging&&) = default;
|
|
void LogImpl(const char* String) const;
|
|
static FLogging* Instance;
|
|
FPath Path;
|
|
FILE* File = nullptr;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
struct FLoggingScope
|
|
{
|
|
FLoggingScope(FPath& Path, const char* LogFileName = nullptr);
|
|
~FLoggingScope();
|
|
|
|
private:
|
|
FLogging* PreviousScope = nullptr;
|
|
}; |