From 74c9ac48b3937ebda35ba1109694ab922e799b83 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Mon, 9 Dec 2024 16:27:04 +0100 Subject: [PATCH] Clean-up snapshot tracing display code --- .../Cardano/Node/Tracing/Tracers/ChainDB.hs | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs index c6920498fdb..ec1ddda22a2 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs @@ -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{} ->