Skip to content

Commit

Permalink
removed Fatal option, copy-pasted tooltips from ELogVerbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
MothDoctor committed Oct 25, 2021
1 parent 889624b commit aa68c4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
21 changes: 9 additions & 12 deletions Source/Flow/Private/Nodes/Utils/FlowNode_Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
UFlowNode_Log::UFlowNode_Log(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, Message(TEXT("Log!"))
, Verbosity(EFlowLogVerbosity::Warning)
, bPrintToScreen(true)
, Duration(5.0f)
, TextColor(FColor::Yellow)
Expand All @@ -19,24 +20,25 @@ void UFlowNode_Log::ExecuteInput(const FName& PinName)
{
switch (Verbosity)
{
case EFlowLogVerbosity::Log:
UE_LOG(LogFlow, Log, TEXT("%s"), *Message);
case EFlowLogVerbosity::Error:
UE_LOG(LogFlow, Error, TEXT("%s"), *Message);
break;
case EFlowLogVerbosity::Warning:
UE_LOG(LogFlow, Warning, TEXT("%s"), *Message);
break;
case EFlowLogVerbosity::Error:
UE_LOG(LogFlow, Error, TEXT("%s"), *Message);
case EFlowLogVerbosity::Display:
UE_LOG(LogFlow, Display, TEXT("%s"), *Message);
break;
case EFlowLogVerbosity::Log:
UE_LOG(LogFlow, Log, TEXT("%s"), *Message);
break;
case EFlowLogVerbosity::Verbose:
UE_LOG(LogFlow, Verbose, TEXT("%s"), *Message);
break;
case EFlowLogVerbosity::VeryVerbose:
UE_LOG(LogFlow, VeryVerbose, TEXT("%s"), *Message);
break;
case EFlowLogVerbosity::Fatal:
UE_LOG(LogFlow, Fatal, TEXT("%s"), *Message);
default:;
default: ;
}

if (bPrintToScreen)
Expand All @@ -50,11 +52,6 @@ void UFlowNode_Log::ExecuteInput(const FName& PinName)
#if WITH_EDITOR
FString UFlowNode_Log::GetNodeDescription() const
{
if (Verbosity == EFlowLogVerbosity::Fatal)
{
return FString::Printf(TEXT("FATAL LOG: %s"), *Message);
}

return Message;
}
#endif
19 changes: 7 additions & 12 deletions Source/Flow/Public/Nodes/Utils/FlowNode_Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@
#include "Nodes/FlowNode.h"
#include "FlowNode_Log.generated.h"

// Variant of ELogVerbosity
UENUM(BlueprintType)
enum class EFlowLogVerbosity : uint8
{
Log,
Warning,
Error,
Verbose,
VeryVerbose,

/**
* Here be dragons
* This is the fatal log which means it will literally completely crash your editor/game.
* You've been warned. Use with caution.
*/
Fatal UMETA(DisplaName = "Fatal (USE WITH CAUTION)")
Error UMETA(ToolTip = "Prints a message to console (and log file)"),
Warning UMETA(ToolTip = "Prints a message to console (and log file)"),
Display UMETA(ToolTip = "Prints a message to console (and log file)"),
Log UMETA(ToolTip = "Prints a message to a log file (does not print to console)"),
Verbose UMETA(ToolTip = "Prints a verbose message to a log file (if Verbose logging is enabled for the given category, usually used for detailed logging)"),
VeryVerbose UMETA(ToolTip = "Prints a verbose message to a log file (if VeryVerbose logging is enabled, usually used for detailed logging that would otherwise spam output)"),
};

/**
Expand Down

0 comments on commit aa68c4b

Please sign in to comment.