LEAP Documentation 40220
Documentation for the LEAP project
Debug.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios 2017. All Rights Reserved.
2
3#pragma once
4#include "Color.h"
5
6enum class ELogLevel : uint8
7{
8 Log = 0,
9 Warning = 1,
10 Error = 2
11};
12
13class PROJECTX_API Debug
14{
15public:
16 static void Log(FString output, float TimeToDisplay = 5.0f, FColor Color = FColor::Silver, int32 Key = -1, bool IncludeInLogs = false);
17 static void Log(FString output, FColor Color);
18 static void Log(FString output, bool IncludeInLogs);
19 static void LogServerDedicated(FString output, const UObject* WorldContextObject, float TimeToDisplay = 5.0f, FColor Color = FColor::Silver, int32 Key = -1);
20 static void LogServerListen(FString output, const UObject* WorldContextObject, float TimeToDisplay = 5.0f, FColor Color = FColor::Silver, int32 Key = -1);
21 static void LogServerAny(FString output, const UObject* WorldContextObject, float TimeToDisplay = 5.0f, FColor Color = FColor::Silver, int32 Key = -1);
22 static void LogClientNonServer(FString output, const UObject* WorldContextObject, float TimeToDisplay = 5.0f, FColor Color = FColor::Silver, int32 Key = -1);
23 static void LogClientAny(FString output, const UObject* WorldContextObject, float TimeToDisplay = 5.0f, FColor Color = FColor::Silver, int32 Key = -1);
24 static void LogOffscreenOnly(FString output, ELogLevel OffscreenLogLevel = ELogLevel::Log);
25
26 /* Mimmicks Blueprint Print which outputs whether the log occured on the server or client. */
27 static void Print(FString output, const UObject* WorldContextObject, float TimeToDisplay = 5.0f, FColor Color = FColor::Cyan, int32 Key = -1, bool IncludeInLogs = false);
28 static void Print(FString output, const UObject* WorldContextObject, bool IncludeInLogs);
29 static void Print(const UObject* WorldContextObject, FString output, bool IncludeInLogs);
30};
31
32#if UE_BUILD_SHIPPING
33
34#define ProjectXEnsure(InExpression) (!!(InExpression))
35#define ProjectXEnsureMsgf(InExpression, InFormat, ... ) (!!(InExpression))
36
37#else
38
39#define ProjectXEnsure(InExpression) { if(UNLIKELY(!(InExpression))) { FDebug::LogAssertFailedMessage( #InExpression, __FILE__, __LINE__ ); if (UE4Asserts_Private::TrueOnFirstCallOnly([]{})) { _DebugBreakAndPromptForRemote(); } } }
40#define ProjectXEnsureMsgf(InExpression, InFormat, ... ) { if(UNLIKELY(!(InExpression))) { FDebug::LogAssertFailedMessage( #InExpression, __FILE__, __LINE__, InFormat, ##__VA_ARGS__ ); if (UE4Asserts_Private::TrueOnFirstCallOnly([]{})) { _DebugBreakAndPromptForRemote(); } } }
41
42#endif
ELogLevel
Definition: Debug.h:7
Definition: Debug.h:14