Skip to content

Commit

Permalink
Clean-up snapshot tracing display code
Browse files Browse the repository at this point in the history
Remember that `Text.unwords` exists
  • Loading branch information
geo2a committed Dec 12, 2024
1 parent 44356ea commit 0417d03
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,15 +1507,27 @@ instance ( StandardHash blk
, ConvertRawHash blk)
=> LogFormatting (LedgerDB.TraceSnapshotEvent blk) where
forHuman (LedgerDB.TookSnapshot snap pt RisingEdge) =
"Taking ledger snapshot " <> showT snap <>
" at " <> renderRealPointAsPhrase pt
Text.unwords [ "Taking ledger snapshot"
, showT snap
, "at"
, renderRealPointAsPhrase pt
]
forHuman (LedgerDB.TookSnapshot snap pt (FallingEdgeWith t)) =
"Took ledger snapshot " <> showT snap <>
" at " <> renderRealPointAsPhrase pt <> ", duration: " <> showT t
Text.unwords [ "Took ledger snapshot"
, showT snap
, "at"
, renderRealPointAsPhrase pt
, ", duration:"
, showT t
]
forHuman (LedgerDB.DeletedSnapshot snap) =
"Deleted old snapshot " <> showT snap
Text.unwords ["Deleted old snapshot", showT snap]
forHuman (LedgerDB.InvalidSnapshot snap failure) =
"Invalid snapshot " <> showT snap <> showT failure <> context
Text.unwords [ "Invalid snapshot"
, showT snap
, showT failure
, context
]
where
context = case failure of
LedgerDB.InitFailureRead{} ->
Expand Down

0 comments on commit 0417d03

Please sign in to comment.