Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Source/Flow/Private/FlowComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,24 @@ void UFlowComponent::OnRep_IdentityTags(const FGameplayTagContainer& PreviousTag

void UFlowComponent::VerifyIdentityTags() const
{
#if !NO_LOGGING || UE_ENABLE_DEBUG_DRAWING
if (IdentityTags.IsEmpty() && GetDefault<UFlowSettings>()->bWarnAboutMissingIdentityTags)
{
FString Message = TEXT("Missing Identity Tags on the Flow Component creating Flow Asset instance! This gonna break loading SaveGame for this component!");
Message.Append(LINE_TERMINATOR).Append(TEXT("If you're not using SaveSystem, you can silence this warning by unchecking bWarnAboutMissingIdentityTags flag in Flow Settings."));
LogError(Message);
}
#endif
}

void UFlowComponent::LogError(FString Message, const EFlowOnScreenMessageType OnScreenMessageType) const
{
#if !NO_LOGGING || UE_ENABLE_DEBUG_DRAWING
Message += TEXT(" --- Flow Component in actor ") + GetOwner()->GetName();

UE_LOG(LogFlow, Error, TEXT("%s"), *Message);
#endif

#if UE_ENABLE_DEBUG_DRAWING
if (OnScreenMessageType == EFlowOnScreenMessageType::Permanent)
{
if (UWorld* World = GetWorld())
Expand All @@ -302,8 +308,7 @@ void UFlowComponent::LogError(FString Message, const EFlowOnScreenMessageType On
{
GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Red, Message);
}

UE_LOG(LogFlow, Error, TEXT("%s"), *Message);
#endif
}

void UFlowComponent::NotifyGraph(const FGameplayTag NotifyTag, const EFlowNetMode NetMode /* = EFlowNetMode::Authority*/)
Expand Down
32 changes: 17 additions & 15 deletions Source/Flow/Private/Nodes/FlowNodeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,21 @@ void UFlowNodeBase::UpdateNodeConfigText_Implementation()

void UFlowNodeBase::LogError(FString Message, const EFlowOnScreenMessageType OnScreenMessageType) const
{
#if !UE_BUILD_SHIPPING
#if !NO_LOGGING || UE_ENABLE_DEBUG_DRAWING
if (BuildMessage(Message))
{
// Output Log
UE_LOG(LogFlow, Error, TEXT("%s"), *Message);

#if WITH_EDITOR
if (GEditor)
{
// Message Log
GetFlowAsset()->GetTemplateAsset()->LogError(Message, this);
}
#endif

#if UE_ENABLE_DEBUG_DRAWING
// OnScreen Message
if (OnScreenMessageType == EFlowOnScreenMessageType::Permanent)
{
Expand All @@ -894,24 +906,14 @@ void UFlowNodeBase::LogError(FString Message, const EFlowOnScreenMessageType OnS
{
GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Red, Message);
}

// Output Log
UE_LOG(LogFlow, Error, TEXT("%s"), *Message);

#if WITH_EDITOR
if (GEditor)
{
// Message Log
GetFlowAsset()->GetTemplateAsset()->LogError(Message, this);
}
#endif
}
#endif
}

void UFlowNodeBase::LogWarning(FString Message) const
{
#if !UE_BUILD_SHIPPING
#if !NO_LOGGING
if (BuildMessage(Message))
{
// Output Log
Expand All @@ -930,7 +932,7 @@ void UFlowNodeBase::LogWarning(FString Message) const

void UFlowNodeBase::LogNote(FString Message) const
{
#if !UE_BUILD_SHIPPING
#if !NO_LOGGING
if (BuildMessage(Message))
{
// Output Log
Expand All @@ -949,7 +951,7 @@ void UFlowNodeBase::LogNote(FString Message) const

void UFlowNodeBase::LogVerbose(FString Message) const
{
#if !UE_BUILD_SHIPPING
#if !NO_LOGGING
if (BuildMessage(Message))
{
// Output Log
Expand All @@ -958,7 +960,7 @@ void UFlowNodeBase::LogVerbose(FString Message) const
#endif
}

#if !UE_BUILD_SHIPPING
#if !NO_LOGGING || UE_ENABLE_DEBUG_DRAWING
bool UFlowNodeBase::BuildMessage(FString& Message) const
{
const UFlowAsset* FlowAsset = GetFlowAsset();
Expand Down
2 changes: 1 addition & 1 deletion Source/Flow/Public/Nodes/FlowNodeBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class FLOW_API UFlowNodeBase
UFUNCTION(BlueprintCallable, Category = "FlowNode", meta = (DevelopmentOnly))
void LogVerbose(FString Message) const;

#if !UE_BUILD_SHIPPING
#if !NO_LOGGING || UE_ENABLE_DEBUG_DRAWING
protected:
bool BuildMessage(FString& Message) const;
#endif
Expand Down