forked from geode-sdk/android-launcher
automatically trim log messages
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -161,7 +161,7 @@ fun LogCard(logLine: LogLine, modifier: Modifier = Modifier) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
"[${logLine.tag}]: ${logLine.message}",
|
"[${logLine.tag}]: ${logLine.messageTrimmed}",
|
||||||
fontFamily = FontFamily.Monospace,
|
fontFamily = FontFamily.Monospace,
|
||||||
style = Typography.bodyMedium
|
style = Typography.bodyMedium
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -153,8 +153,10 @@ data class LogLine(
|
|||||||
|
|
||||||
val identifier = time.toJavaInstant()
|
val identifier = time.toJavaInstant()
|
||||||
|
|
||||||
|
val messageTrimmed by lazy { this.message.trim() }
|
||||||
|
|
||||||
val formattedTime by lazy { this.time.toLocalDateTime(TimeZone.currentSystemDefault()) }
|
val formattedTime by lazy { this.time.toLocalDateTime(TimeZone.currentSystemDefault()) }
|
||||||
val asSimpleString by lazy {
|
val asSimpleString by lazy {
|
||||||
"$formattedTime [${this.priority.toChar()}/${this.tag}]: ${this.message}"
|
"$formattedTime [${this.priority.toChar()}/${this.tag}]: ${this.messageTrimmed}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user