@@ -121,8 +121,10 @@ func extractLogEntryFromOTLPRecord(record *logspb.LogRecord) *tui.LogEntry {
121
121
122
122
// createFallbackLogEntry creates a basic LogEntry for unparseable lines
123
123
func createFallbackLogEntry (line string ) * tui.LogEntry {
124
- // Replace tabs with spaces to prevent formatting issues
124
+ // Replace tabs and newlines with spaces to prevent formatting issues
125
125
cleanLine := strings .ReplaceAll (line , "\t " , " " )
126
+ cleanLine = strings .ReplaceAll (cleanLine , "\n " , " " )
127
+ cleanLine = strings .ReplaceAll (cleanLine , "\r " , " " )
126
128
127
129
// Extract severity from the message text instead of defaulting to INFO
128
130
severity := extractSeverityFromText (cleanLine )
@@ -213,8 +215,11 @@ func extractMessageFromBody(body *commonpb.AnyValue) string {
213
215
214
216
switch v := body .Value .(type ) {
215
217
case * commonpb.AnyValue_StringValue :
216
- // Replace tabs with spaces to prevent formatting issues
217
- return strings .ReplaceAll (v .StringValue , "\t " , " " )
218
+ // Replace tabs and newlines with spaces to prevent formatting issues
219
+ msg := strings .ReplaceAll (v .StringValue , "\t " , " " )
220
+ msg = strings .ReplaceAll (msg , "\n " , " " )
221
+ msg = strings .ReplaceAll (msg , "\r " , " " )
222
+ return msg
218
223
case * commonpb.AnyValue_IntValue :
219
224
return fmt .Sprintf ("%d" , v .IntValue )
220
225
case * commonpb.AnyValue_DoubleValue :
0 commit comments