Skip to content

Commit

Permalink
Improved tostring
Browse files Browse the repository at this point in the history
  • Loading branch information
kimble committed Dec 22, 2023
1 parent 50f36cd commit 1e6bbd4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ sealed class ThingState {
override val timestamp: Instant
get() = lines.last().timestamp

override fun toString(): String {
return lines.joinToString("\n")
}

data class Line(
val timestamp: Instant,
val message: String,
Expand All @@ -94,6 +98,10 @@ sealed class ThingState {
override fun compareTo(other: Line): Int {
return timestamp.compareTo(other.timestamp)
}

override fun toString(): String {
return "$timestamp - $level: $message"
}
}

companion object {
Expand Down

0 comments on commit 1e6bbd4

Please sign in to comment.