Skip to content

Commit

Permalink
CAD-2770 trace-dispatcher: TracingOnNew -> TraceDispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire authored and jutaro committed May 13, 2021
1 parent 9e63fae commit 2912e72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cardano-node/src/Cardano/Node/Run.hs
Expand Up @@ -163,7 +163,7 @@ logTracingVerbosity nc tracer =
NormalVerbosity -> traceWith tracer "tracing verbosity = normal verbosity "
MinimalVerbosity -> traceWith tracer "tracing verbosity = minimal verbosity "
MaximalVerbosity -> traceWith tracer "tracing verbosity = maximal verbosity "
TracingOnNew traceConf ->
TraceDispatcher traceConf ->
case traceVerbosity traceConf of
NormalVerbosity -> traceWith tracer "tracing verbosity = normal verbosity "
MinimalVerbosity -> traceWith tracer "tracing verbosity = minimal verbosity "
Expand Down
8 changes: 4 additions & 4 deletions cardano-node/src/Cardano/Tracing/Config.hs
Expand Up @@ -26,7 +26,7 @@ import Cardano.Node.Orphans ()
data TraceOptions
= TracingOff
| TracingOn TraceSelection
| TracingOnNew TraceSelection
| TraceDispatcher TraceSelection
deriving (Eq, Show)

type TraceAcceptPolicy = ("TraceAcceptPolicy" :: Symbol)
Expand Down Expand Up @@ -115,8 +115,8 @@ data TraceSelection
} deriving (Eq, Show)


traceConfigParser :: Object -> Parser TraceOptions
traceConfigParser v =
traceConfigParser :: Object -> (TraceSelection -> TraceOptions) -> Parser TraceOptions
traceConfigParser v ctor =
let acceptPolicy :: OnOff TraceAcceptPolicy
acceptPolicy = OnOff False
blockFetchClient :: OnOff TraceBlockFetchClient
Expand Down Expand Up @@ -186,7 +186,7 @@ traceConfigParser v =
txSubmission2Protocol :: OnOff TraceTxSubmission2Protocol
txSubmission2Protocol = OnOff False in

TracingOnNew <$> (TraceSelection
ctor <$> (TraceSelection
<$> v .:? "TracingVerbosity" .!= NormalVerbosity
-- Per-trace toggles, alpha-sorted.
<*> v .:? getName acceptPolicy .!= acceptPolicy
Expand Down
4 changes: 2 additions & 2 deletions cardano-node/src/Cardano/Tracing/Tracers.hs
Expand Up @@ -293,7 +293,7 @@ mkTracers
-> NodeKernelData blk
-> Maybe EKGDirect
-> IO (Tracers peer localPeer blk)
mkTracers _ TracingOnNew{} _ _ _ = do
mkTracers _ TraceDispatcher{} _ _ _ = do

trBaseL2 <- L2.standardTracer Nothing
trL2 <- L2.machineFormatter L2.DRegular "cardano" trBaseL2
Expand Down Expand Up @@ -446,7 +446,7 @@ teeTraceChainTip
-> Trace IO Text
-> Tracer IO (WithSeverity (ChainDB.TraceEvent blk))
teeTraceChainTip _ _ TracingOff _ _ _ _ = nullTracer
teeTraceChainTip _ _ TracingOnNew{} _ _ _ _ = nullTracer
teeTraceChainTip _ _ TraceDispatcher{} _ _ _ _ = nullTracer
teeTraceChainTip blockConfig fStats (TracingOn trSel) elided ekgDirect trTrc trMet =
Tracer $ \ev -> do
traceWith (teeTraceChainTipElide (traceVerbosity trSel) elided trTrc) ev
Expand Down

0 comments on commit 2912e72

Please sign in to comment.