Skip to content

Commit

Permalink
Clean-up snapshot tracing display code
Browse files Browse the repository at this point in the history
  • Loading branch information
geo2a committed Dec 9, 2024
1 parent 44356ea commit 74c9ac4
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.intercalate " " [ "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.intercalate " " [ "Took ledger snapshot"
, showT snap
, "at"
, renderRealPointAsPhrase pt
, ", duration:"
, showT t
]
forHuman (LedgerDB.DeletedSnapshot snap) =
"Deleted old snapshot " <> showT snap
Text.intercalate " " ["Deleted old snapshot", showT snap]
forHuman (LedgerDB.InvalidSnapshot snap failure) =
"Invalid snapshot " <> showT snap <> showT failure <> context
Text.intercalate " " [ "Invalid snapshot"
, showT snap
, showT failure
, context
]
where
context = case failure of
LedgerDB.InitFailureRead{} ->
Expand Down

0 comments on commit 74c9ac4

Please sign in to comment.