Skip to content

Commit

Permalink
Add --quiet option to restore bench
Browse files Browse the repository at this point in the history
which silences the verbose tick output to stdout.
  • Loading branch information
Anviking committed Oct 19, 2020
1 parent cf900bf commit 9b22f9e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/core-integration/src/Cardano/Wallet/BenchShared.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Cardano.BM.Data.Severity
import Cardano.BM.Setup
( setupTrace_ )
import Cardano.BM.Trace
( Trace )
( Trace, nullTracer )
import Cardano.Launcher.Node
( CardanoNodeConfig (..)
, CardanoNodeConn (..)
Expand Down Expand Up @@ -83,6 +83,7 @@ import Options.Applicative
, showDefaultWith
, strArgument
, strOption
, switch
, value
)
import Say
Expand Down Expand Up @@ -117,7 +118,8 @@ execBenchWithNode networkConfig action = do
hSetBuffering stdout NoBuffering
hSetBuffering stderr NoBuffering

(_logCfg, tr) <- initBenchmarkLogging Info
(_logCfg, tr') <- initBenchmarkLogging Info
let tr = if argQuiet args then nullTracer else tr'
installSignalHandlers (return ())

case argUseAlreadyRunningNodeSocketPath args of
Expand Down Expand Up @@ -165,6 +167,7 @@ data RestoreBenchArgs = RestoreBenchArgs
, argConfigsDir :: FilePath
, argNodeDatabaseDir :: Maybe FilePath
, argUseAlreadyRunningNodeSocketPath :: Maybe FilePath
, argQuiet :: Bool
} deriving (Show, Eq)

restoreBenchArgsParser
Expand Down Expand Up @@ -198,6 +201,9 @@ restoreBenchArgsParser envNetwork envConfigsDir envNodeDatabaseDir = RestoreBenc
<> help "Path to the socket of an already running cardano-node. \
\Also set by $CARDANO_NODE_SOCKET. If not set, cardano-node \
\will automatically be started."))
<*> switch
( long ("quiet")
<> help "Reduce unnecessary log output.")
where
envDefault :: HasValue f => String -> Maybe a -> Mod f a
envDefault name env = showDefaultWith (const ('$':name))
Expand Down

0 comments on commit 9b22f9e

Please sign in to comment.