Skip to content

Commit

Permalink
shorten jvm id for debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgk committed Sep 3, 2024
1 parent 17d7406 commit ce970ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Modules/RDTs/src/main/scala/rdts/base/Uid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import scala.annotation.implicitNotFound
/** Uid’s are serializable abstract unique Ids. Currently implemented as Strings, but subject to change. */
case class Uid(delegate: String) derives CanEqual {
override def toString: String = show
def show: String = s"🪪$delegate"
def show: String =
val offset = delegate.indexOf('.')
val shortened = if offset > 0 then delegate.substring(0, offset + 4) else delegate
s"🪪$shortened"
}

object Uid:
Expand Down

0 comments on commit ce970ec

Please sign in to comment.