@@ -19,7 +19,7 @@ import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as LSQ
1919import qualified Ouroboros.Network.Protocol.LocalTxMonitor.Type as LTM
2020import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LTS
2121
22- import Data.Aeson (Value (String ), (.=) )
22+ import Data.Aeson (Value (String ), (.=) , (.?=) )
2323import Data.Text (Text , pack )
2424import qualified Network.TypedProtocol.Codec as Simple
2525import qualified Network.TypedProtocol.Stateful.Codec as Stateful
@@ -28,62 +28,62 @@ import qualified Network.TypedProtocol.Stateful.Codec as Stateful
2828
2929instance LogFormatting (Simple. AnyMessage ps )
3030 => LogFormatting (Simple. TraceSendRecv ps ) where
31- forMachine dtal (Simple. TraceSendMsg m) = mconcat
32- [ " kind" .= String " Send" , " msg" .= forMachine dtal m ]
33- forMachine dtal (Simple. TraceRecvMsg m) = mconcat
34- [ " kind" .= String " Recv" , " msg" .= forMachine dtal m ]
31+ forMachine dtal (Simple. TraceSendMsg tm m) = mconcat
32+ [ " kind" .= String " Send" , " msg" .= forMachine dtal m, " tm " .= String (pack $ show tm) ]
33+ forMachine dtal (Simple. TraceRecvMsg mbTm m) = mconcat
34+ [ " kind" .= String " Recv" , " msg" .= forMachine dtal m, " tm " .?= fmap ( String . pack . show ) mbTm ]
3535
36- forHuman (Simple. TraceSendMsg m) = " Send: " <> forHumanOrMachine m
37- forHuman (Simple. TraceRecvMsg m) = " Receive: " <> forHumanOrMachine m
36+ forHuman (Simple. TraceSendMsg _tm m) = " Send: " <> forHumanOrMachine m
37+ forHuman (Simple. TraceRecvMsg _mbTm m) = " Receive: " <> forHumanOrMachine m
3838
39- asMetrics (Simple. TraceSendMsg m) = asMetrics m
40- asMetrics (Simple. TraceRecvMsg m) = asMetrics m
39+ asMetrics (Simple. TraceSendMsg _tm m) = asMetrics m
40+ asMetrics (Simple. TraceRecvMsg _mbTm m) = asMetrics m
4141
4242instance LogFormatting (Stateful. AnyMessage ps f )
4343 => LogFormatting (Stateful. TraceSendRecv ps f ) where
44- forMachine dtal (Stateful. TraceSendMsg m) = mconcat
45- [ " kind" .= String " Send" , " msg" .= forMachine dtal m ]
46- forMachine dtal (Stateful. TraceRecvMsg m) = mconcat
47- [ " kind" .= String " Recv" , " msg" .= forMachine dtal m ]
44+ forMachine dtal (Stateful. TraceSendMsg tm m) = mconcat
45+ [ " kind" .= String " Send" , " msg" .= forMachine dtal m, " tm " .= String (pack $ show tm) ]
46+ forMachine dtal (Stateful. TraceRecvMsg mbTm m) = mconcat
47+ [ " kind" .= String " Recv" , " msg" .= forMachine dtal m, " tm " .?= fmap ( String . pack . show ) mbTm ]
4848
49- forHuman (Stateful. TraceSendMsg m) = " Send: " <> forHumanOrMachine m
50- forHuman (Stateful. TraceRecvMsg m) = " Receive: " <> forHumanOrMachine m
49+ forHuman (Stateful. TraceSendMsg _tm m) = " Send: " <> forHumanOrMachine m
50+ forHuman (Stateful. TraceRecvMsg _mbTm m) = " Receive: " <> forHumanOrMachine m
5151
52- asMetrics (Stateful. TraceSendMsg m) = asMetrics m
53- asMetrics (Stateful. TraceRecvMsg m) = asMetrics m
52+ asMetrics (Stateful. TraceSendMsg _tm m) = asMetrics m
53+ asMetrics (Stateful. TraceRecvMsg _mbTm m) = asMetrics m
5454
5555instance MetaTrace (Simple. AnyMessage ps ) =>
5656 MetaTrace (Simple. TraceSendRecv ps ) where
57- namespaceFor (Simple. TraceSendMsg msg) =
57+ namespaceFor (Simple. TraceSendMsg _tm msg) =
5858 nsPrependInner " Send" (namespaceFor msg)
59- namespaceFor (Simple. TraceRecvMsg msg) =
59+ namespaceFor (Simple. TraceRecvMsg _mbTm msg) =
6060 nsPrependInner " Receive" (namespaceFor msg)
6161
62- severityFor (Namespace out (" Send" : tl)) (Just (Simple. TraceSendMsg msg)) =
62+ severityFor (Namespace out (" Send" : tl)) (Just (Simple. TraceSendMsg _tm msg)) =
6363 severityFor (Namespace out tl) (Just msg)
6464 severityFor (Namespace out (" Send" : tl)) Nothing =
6565 severityFor (Namespace out tl :: Namespace (Simple. AnyMessage ps )) Nothing
66- severityFor (Namespace out (" Receive" : tl)) (Just (Simple. TraceSendMsg msg)) =
66+ severityFor (Namespace out (" Receive" : tl)) (Just (Simple. TraceSendMsg _tm msg)) =
6767 severityFor (Namespace out tl) (Just msg)
6868 severityFor (Namespace out (" Receive" : tl)) Nothing =
6969 severityFor (Namespace out tl :: Namespace (Simple. AnyMessage ps )) Nothing
7070 severityFor _ _ = Nothing
7171
72- privacyFor (Namespace out (" Send" : tl)) (Just (Simple. TraceSendMsg msg)) =
72+ privacyFor (Namespace out (" Send" : tl)) (Just (Simple. TraceSendMsg _tm msg)) =
7373 privacyFor (Namespace out tl) (Just msg)
7474 privacyFor (Namespace out (" Send" : tl)) Nothing =
7575 privacyFor (Namespace out tl :: Namespace (Simple. AnyMessage ps )) Nothing
76- privacyFor (Namespace out (" Receive" : tl)) (Just (Simple. TraceSendMsg msg)) =
76+ privacyFor (Namespace out (" Receive" : tl)) (Just (Simple. TraceSendMsg _tm msg)) =
7777 privacyFor (Namespace out tl) (Just msg)
7878 privacyFor (Namespace out (" Receive" : tl)) Nothing =
7979 privacyFor (Namespace out tl :: Namespace (Simple. AnyMessage ps )) Nothing
8080 privacyFor _ _ = Nothing
8181
82- detailsFor (Namespace out (" Send" : tl)) (Just (Simple. TraceSendMsg msg)) =
82+ detailsFor (Namespace out (" Send" : tl)) (Just (Simple. TraceSendMsg _tm msg)) =
8383 detailsFor (Namespace out tl) (Just msg)
8484 detailsFor (Namespace out (" Send" : tl)) Nothing =
8585 detailsFor (Namespace out tl :: Namespace (Simple. AnyMessage ps )) Nothing
86- detailsFor (Namespace out (" Receive" : tl)) (Just (Simple. TraceSendMsg msg)) =
86+ detailsFor (Namespace out (" Receive" : tl)) (Just (Simple. TraceSendMsg _tm msg)) =
8787 detailsFor (Namespace out tl) (Just msg)
8888 detailsFor (Namespace out (" Receive" : tl)) Nothing =
8989 detailsFor (Namespace out tl :: Namespace (Simple. AnyMessage ps )) Nothing
@@ -107,36 +107,36 @@ instance MetaTrace (Simple.AnyMessage ps) =>
107107
108108instance MetaTrace (Stateful. AnyMessage ps f ) =>
109109 MetaTrace (Stateful. TraceSendRecv ps f ) where
110- namespaceFor (Stateful. TraceSendMsg msg) =
110+ namespaceFor (Stateful. TraceSendMsg _tm msg) =
111111 nsPrependInner " Send" (namespaceFor msg)
112- namespaceFor (Stateful. TraceRecvMsg msg) =
112+ namespaceFor (Stateful. TraceRecvMsg _mbTm msg) =
113113 nsPrependInner " Receive" (namespaceFor msg)
114114
115- severityFor (Namespace out (" Send" : tl)) (Just (Stateful. TraceSendMsg msg)) =
115+ severityFor (Namespace out (" Send" : tl)) (Just (Stateful. TraceSendMsg _tm msg)) =
116116 severityFor (Namespace out tl) (Just msg)
117117 severityFor (Namespace out (" Send" : tl)) Nothing =
118118 severityFor (Namespace out tl :: Namespace (Stateful. AnyMessage ps f )) Nothing
119- severityFor (Namespace out (" Receive" : tl)) (Just (Stateful. TraceSendMsg msg)) =
119+ severityFor (Namespace out (" Receive" : tl)) (Just (Stateful. TraceSendMsg _tm msg)) =
120120 severityFor (Namespace out tl) (Just msg)
121121 severityFor (Namespace out (" Receive" : tl)) Nothing =
122122 severityFor (Namespace out tl :: Namespace (Stateful. AnyMessage ps f )) Nothing
123123 severityFor _ _ = Nothing
124124
125- privacyFor (Namespace out (" Send" : tl)) (Just (Stateful. TraceSendMsg msg)) =
125+ privacyFor (Namespace out (" Send" : tl)) (Just (Stateful. TraceSendMsg _tm msg)) =
126126 privacyFor (Namespace out tl) (Just msg)
127127 privacyFor (Namespace out (" Send" : tl)) Nothing =
128128 privacyFor (Namespace out tl :: Namespace (Stateful. AnyMessage ps f )) Nothing
129- privacyFor (Namespace out (" Receive" : tl)) (Just (Stateful. TraceSendMsg msg)) =
129+ privacyFor (Namespace out (" Receive" : tl)) (Just (Stateful. TraceSendMsg _tm msg)) =
130130 privacyFor (Namespace out tl) (Just msg)
131131 privacyFor (Namespace out (" Receive" : tl)) Nothing =
132132 privacyFor (Namespace out tl :: Namespace (Stateful. AnyMessage ps f )) Nothing
133133 privacyFor _ _ = Nothing
134134
135- detailsFor (Namespace out (" Send" : tl)) (Just (Stateful. TraceSendMsg msg)) =
135+ detailsFor (Namespace out (" Send" : tl)) (Just (Stateful. TraceSendMsg _tm msg)) =
136136 detailsFor (Namespace out tl) (Just msg)
137137 detailsFor (Namespace out (" Send" : tl)) Nothing =
138138 detailsFor (Namespace out tl :: Namespace (Stateful. AnyMessage ps f )) Nothing
139- detailsFor (Namespace out (" Receive" : tl)) (Just (Stateful. TraceSendMsg msg)) =
139+ detailsFor (Namespace out (" Receive" : tl)) (Just (Stateful. TraceSendMsg _tm msg)) =
140140 detailsFor (Namespace out tl) (Just msg)
141141 detailsFor (Namespace out (" Receive" : tl)) Nothing =
142142 detailsFor (Namespace out tl :: Namespace (Stateful. AnyMessage ps f )) Nothing
0 commit comments