105 if (Category == NAME_Cmd)
107 Style =
FName(TEXT(
"Log.Command"));
109 else if (Verbosity == ELogVerbosity::Error)
111 Style =
FName(TEXT(
"Log.Error"));
113 else if (Verbosity == ELogVerbosity::Warning)
115 Style =
FName(TEXT(
"Log.Warning"));
119 Style =
FName(TEXT(
"Log.Normal"));
124 static ELogTimes::Type LogTimestampMode = ELogTimes::None;
131 const int32 OldNumMessages = OutMessages.Num();
134 TArray<FTextRange> LineRanges;
135 FString CurrentLogDump = V;
136 FTextRange::CalculateLineRangesFromString(CurrentLogDump, LineRanges);
138 bool bIsFirstLineInMessage =
true;
139 for (
const FTextRange& LineRange : LineRanges)
141 if (!LineRange.IsEmpty())
143 FString Line = CurrentLogDump.Mid(LineRange.BeginIndex, LineRange.Len());
144 Line = Line.ConvertTabsToSpaces(4);
148 for (int32 CurrentStartIndex = 0; CurrentStartIndex < Line.Len();)
150 int32 HardWrapLineLen = 0;
151 if (bIsFirstLineInMessage)
153 FString MessagePrefix = FOutputDeviceHelper::FormatLogLine(Verbosity, Category,
nullptr, LogTimestampMode);
155 HardWrapLineLen = FMath::Min(HardWrapLen - MessagePrefix.Len(), Line.Len() - CurrentStartIndex);
156 FString HardWrapLine = Line.Mid(CurrentStartIndex, HardWrapLineLen);
158 OutMessages.Add(MakeShareable(
new FVRLogMessage(MakeShareable(
new FString(MessagePrefix + HardWrapLine)), Verbosity, Category, Style)));
162 HardWrapLineLen = FMath::Min(HardWrapLen, Line.Len() - CurrentStartIndex);
163 FString HardWrapLine = Line.Mid(CurrentStartIndex, HardWrapLineLen);
165 OutMessages.Add(MakeShareable(
new FVRLogMessage(MakeShareable(
new FString(MoveTemp(HardWrapLine))), Verbosity, Category, Style)));
168 bIsFirstLineInMessage =
false;
169 CurrentStartIndex += HardWrapLineLen;
174 int numMessages = OutMessages.Num();
179 if (OldNumMessages != numMessages)
182 return OldNumMessages != numMessages;