Skip to content

Commit 09c65db

Browse files
committed
db-analyser: only print microsecond timestamps
This makes sure that all timestamps have equal "width" when printed.
1 parent 126de8e commit 09c65db

File tree

1 file changed

+2
-1
lines changed
  • ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser

1 file changed

+2
-1
lines changed

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Run.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import Ouroboros.Consensus.Util.IOLike
3434
import Ouroboros.Consensus.Util.Orphans ()
3535
import Ouroboros.Consensus.Util.ResourceRegistry
3636
import System.IO
37+
import Text.Printf (printf)
3738

3839

3940
{-------------------------------------------------------------------------------
@@ -132,7 +133,7 @@ analyse DBAnalyserConfig{analysis, confLimit, dbDir, selectDB, validation, verbo
132133
return $ Tracer $ \ev -> withLock $ do
133134
traceTime <- getMonotonicTime
134135
let diff = diffTime traceTime startTime
135-
hPutStrLn stderr $ concat ["[", show diff, "] ", show ev]
136+
hPutStrLn stderr $ printf "[%.6fs] %s" (realToFrac diff :: Double) (show ev)
136137
hFlush stderr
137138
where
138139
withLock = bracket_ (takeMVar lock) (putMVar lock ())

0 commit comments

Comments
 (0)