You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Before: 3548 unity files Total CPU Time: 47343.578125 s Total time in Parallel executor: 494.60 seconds After: 3445 unity files Total CPU Time: 46044.671875 s Total time in Parallel executor: 468.51 seconds #jira #preflight 63336159b20e73a098b7f24f [CL 22218213 by bryan sefcik in ue5-main branch]
76 lines
2.1 KiB
C++
76 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "StateTreeCompilerLog.h"
|
|
#include "StateTreeState.h"
|
|
#include "Developer/MessageLog/Public/IMessageLogListing.h"
|
|
#include "Logging/LogCategory.h"
|
|
#include "Misc/UObjectToken.h"
|
|
|
|
#include UE_INLINE_GENERATED_CPP_BY_NAME(StateTreeCompilerLog)
|
|
|
|
#define LOCTEXT_NAMESPACE "StateTreeEditor"
|
|
|
|
void FStateTreeCompilerLog::AppendToLog(IMessageLogListing* LogListing) const
|
|
{
|
|
for (const FStateTreeCompilerLogMessage& StateTreeMessage : Messages)
|
|
{
|
|
TSharedRef<FTokenizedMessage> Message = FTokenizedMessage::Create((EMessageSeverity::Type)StateTreeMessage.Severity);
|
|
|
|
if (StateTreeMessage.State != nullptr)
|
|
{
|
|
Message->AddToken(FUObjectToken::Create(StateTreeMessage.State, FText::FromName(StateTreeMessage.State->Name)));
|
|
}
|
|
|
|
if (StateTreeMessage.Item.ID.IsValid())
|
|
{
|
|
Message->AddToken(FTextToken::Create(FText::Format(LOCTEXT("LogMessageItem", " {0}"), FText::FromName(StateTreeMessage.Item.Name))));
|
|
}
|
|
|
|
if (!StateTreeMessage.Message.IsEmpty())
|
|
{
|
|
Message->AddToken(FTextToken::Create(FText::FromString(StateTreeMessage.Message)));
|
|
}
|
|
|
|
LogListing->AddMessage(Message);
|
|
}
|
|
}
|
|
|
|
void FStateTreeCompilerLog::DumpToLog(const FLogCategoryBase& Category) const
|
|
{
|
|
for (const FStateTreeCompilerLogMessage& StateTreeMessage : Messages)
|
|
{
|
|
FString Message;
|
|
|
|
if (StateTreeMessage.State != nullptr)
|
|
{
|
|
Message += FString::Printf(TEXT("State '%s': "), *StateTreeMessage.State->Name.ToString());
|
|
}
|
|
|
|
if (StateTreeMessage.Item.ID.IsValid())
|
|
{
|
|
Message += FString::Printf(TEXT("%s '%s': "), *UEnum::GetDisplayValueAsText(StateTreeMessage.Item.DataSource).ToString(), *StateTreeMessage.Item.Name.ToString());
|
|
}
|
|
|
|
Message += StateTreeMessage.Message;
|
|
|
|
switch (StateTreeMessage.Severity)
|
|
{
|
|
case EMessageSeverity::Error:
|
|
UE_LOG_REF(Category, Error, TEXT("%s"), *Message);
|
|
break;
|
|
case EMessageSeverity::PerformanceWarning:
|
|
case EMessageSeverity::Warning:
|
|
UE_LOG_REF(Category, Warning, TEXT("%s"), *Message);
|
|
break;
|
|
case EMessageSeverity::Info:
|
|
default:
|
|
UE_LOG_REF(Category, Log, TEXT("%s"), *Message);
|
|
break;
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|
|
|