show first field if no message

This commit is contained in:
Jana Dönszelmann 2026-02-25 01:10:15 +01:00
parent f733c65bcf
commit 3037d0711e
No known key found for this signature in database

View file

@ -106,6 +106,13 @@ impl LogEntry {
.message() .message()
.map(|i| i.to_string()) .map(|i| i.to_string())
.or_else(|| raw.fields.fields.get("return").map(|i| format!("{i}"))) .or_else(|| raw.fields.fields.get("return").map(|i| format!("{i}")))
.or_else(|| {
raw.fields
.fields
.iter()
.next()
.map(|(k, v)| format!("{k} = {v}"))
})
.unwrap_or_else(|| NO_MESSAGE.to_string()) .unwrap_or_else(|| NO_MESSAGE.to_string())
}; };