Skip to content

Commit

Permalink
Clean up unneeded calls to Show
Browse files Browse the repository at this point in the history
Calling `Show` on an `Int` or `String` doesn't have any particular benefit, particularly if it's inside of a string interpolation anyway
  • Loading branch information
morgen-peschke committed Jun 14, 2024
1 parent 620abc1 commit 8bec275
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ object PagingSelfAwareStructuredLogger {
): F[(String, Map[String, String])] =
randomUUID.map { uuid =>
val logSplitId = uuid.show
val msgLength = msg.length.show
val msgLength = msg.length
(
logSplitId,
ctx
.updated(logSplitIdN, logSplitId)
.updated("page_size", s"${pageSizeK.show} Kib")
.updated("whole_message_size_bytes", msgLength)
.updated("page_size", s"$pageSizeK Kib")
.updated("whole_message_size_bytes", s"$msgLength")
// The following is deprecated
.updated("log_size", s"${msgLength} Byte")
.updated("log_size", s"$msgLength Byte")
)
}

Expand All @@ -142,9 +142,9 @@ object PagingSelfAwareStructuredLogger {
ctx: Map[String, String]
): Map[String, String] =
ctx
.updated("total_pages", totalPages.show)
.updated("page_num", pageNum.show)
.updated("log_size_bytes", page.length.show)
.updated("total_pages", s"$totalPages")
.updated("page_num", s"$pageNum")
.updated("log_size_bytes", s"${page.length}")

private def doLogging(
loggingLevelChk: => F[Boolean],
Expand Down

0 comments on commit 8bec275

Please sign in to comment.