Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add `ccTraceOptions` to `CardanoConfiguration` Add `pccTraceOptions` to `PartialCardanoConfiguration`
- Loading branch information
Showing
11 changed files
with
106 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,85 @@ | ||
{-# LANGUAGE StandaloneDeriving #-} | ||
{-# LANGUAGE FlexibleInstances #-} | ||
{-# LANGUAGE GeneralisedNewtypeDeriving #-} | ||
{-# LANGUAGE StandaloneDeriving #-} | ||
{-# LANGUAGE TypeSynonymInstances #-} | ||
{-# OPTIONS_GHC -Wno-orphans #-} | ||
|
||
module Cardano.Config.Orphanage () | ||
where | ||
module Cardano.Config.Orphanage | ||
( ConsensusTraceOptions | ||
, ProtocolTraceOptions | ||
, TraceOptions(..) | ||
, traceOptionsDefault | ||
) where | ||
|
||
import Cardano.Prelude | ||
import Cardano.Prelude | ||
|
||
import Cardano.BM.Data.Tracer (TracingVerbosity (..)) | ||
import qualified Ouroboros.Consensus.BlockchainTime as Consensus | ||
|
||
import qualified Ouroboros.Consensus.Node.Tracers as ConsensusTracers | ||
import Ouroboros.Consensus.NodeNetwork (ProtocolTracers'(..)) | ||
|
||
deriving instance Eq Consensus.SlotLength | ||
deriving instance Num Consensus.SlotLength | ||
|
||
type ConsensusTraceOptions = ConsensusTracers.Tracers' () () () (Const Bool) | ||
deriving instance Eq ConsensusTraceOptions | ||
deriving instance Show ConsensusTraceOptions | ||
|
||
type ProtocolTraceOptions = ProtocolTracers' () () () (Const Bool) | ||
deriving instance Eq ProtocolTraceOptions | ||
deriving instance Show ProtocolTraceOptions | ||
|
||
-- | Detailed tracing options. Each option enables a tracer | ||
-- which verbosity to the log output. | ||
data TraceOptions = TraceOptions | ||
{ traceVerbosity :: !TracingVerbosity | ||
, traceChainDB :: !Bool | ||
-- ^ By default we use 'readableChainDB' tracer, if on this it will use | ||
-- more verbose tracer | ||
, traceConsensus :: ConsensusTraceOptions | ||
, traceProtocols :: ProtocolTraceOptions | ||
, traceIpSubscription :: !Bool | ||
, traceDnsSubscription :: !Bool | ||
, traceDnsResolver :: !Bool | ||
, traceMux :: !Bool | ||
} deriving (Eq, Show) | ||
|
||
deriving instance Show TracingVerbosity | ||
|
||
consensusTraceDefault :: ConsensusTraceOptions | ||
consensusTraceDefault = | ||
ConsensusTracers.Tracers | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
|
||
protocolTraceDefault :: ProtocolTraceOptions | ||
protocolTraceDefault = | ||
ProtocolTracers | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
(Const True) | ||
|
||
|
||
traceOptionsDefault :: TraceOptions | ||
traceOptionsDefault = | ||
TraceOptions | ||
{ traceVerbosity = NormalVerbosity | ||
, traceChainDB = True | ||
, traceConsensus = consensusTraceDefault | ||
, traceProtocols = protocolTraceDefault | ||
, traceIpSubscription = True | ||
, traceDnsSubscription = True | ||
, traceDnsResolver = True | ||
, traceMux = True | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters