automatically trim log messages

This commit is contained in:
qimiko committed 2024-01-23 01:33:54 -07:00
1 parent 590006413c
commit 665756d85b
2 files changed
+4 -2

No files matched your search

@@ -161,7 +161,7 @@ fun LogCard(logLine: LogLine, modifier: Modifier = Modifier) {
)
Text(
"[${logLine.tag}]: ${logLine.message}",
"[${logLine.tag}]: ${logLine.messageTrimmed}",
fontFamily = FontFamily.Monospace,
style = Typography.bodyMedium
)
@@ -153,8 +153,10 @@ data class LogLine(
val identifier = time.toJavaInstant()
val messageTrimmed by lazy { this.message.trim() }
val formattedTime by lazy { this.time.toLocalDateTime(TimeZone.currentSystemDefault()) }
val asSimpleString by lazy {
"$formattedTime [${this.priority.toChar()}/${this.tag}]: ${this.message}"
"$formattedTime [${this.priority.toChar()}/${this.tag}]: ${this.messageTrimmed}"
}
}