Skip to content

Commit e609e9e

Browse files
committed
Remove use of multiline literals from trace-dispatcher
1 parent 9d3b52d commit e609e9e

File tree

2 files changed

+47
-39
lines changed

2 files changed

+47
-39
lines changed

trace-dispatcher/examples/Examples/TestObjects.hs

+35-30
Original file line numberDiff line numberDiff line change
@@ -112,34 +112,36 @@ instance MetaTrace (TraceForgeEvent blk) where
112112
"Start of the leadership check\n\
113113
\\n\
114114
\We record the current slot number."
115-
documentFor (Namespace _ ["SlotIsImmutable"]) = Just
116-
"Leadership check failed: the tip of the ImmutableDB inhabits the\n\
117-
\current slot\n\
118-
\\n\
119-
\This might happen in two cases.\n\
120-
\\n\
121-
\1. the clock moved backwards, on restart we ignored everything from the\n\
122-
\ VolatileDB since it's all in the future, and now the tip of the\n\
123-
\ ImmutableDB points to a block produced in the same slot we're trying\n\
124-
\ to produce a block in\n\
125-
\\n\
126-
\2. k = 0 and we already adopted a block from another leader of the same\n\
127-
\ slot.\n\
128-
\\n\
129-
\We record both the current slot number as well as the tip of the\n\
130-
\ImmutableDB.\n\
131-
\\n\
132-
\See also <https://github.com/input-output-hk/ouroboros-network/issues/1462>"
133-
documentFor (Namespace _ ["BlockFromFuture"]) = Just
134-
"Leadership check failed: the current chain contains a block from a slot\n\
135-
\/after/ the current slot\n\
136-
\\n\
137-
\This can only happen if the system is under heavy load.\n\
138-
\\n\
139-
\We record both the current slot number as well as the slot number of the\n\
140-
\block at the tip of the chain.\n\
141-
\\n\
142-
\See also <https://github.com/input-output-hk/ouroboros-network/issues/1462>"
115+
documentFor (Namespace _ ["SlotIsImmutable"]) = Just $ mconcat
116+
[ "Leadership check failed: the tip of the ImmutableDB inhabits the\n"
117+
, "current slot\n"
118+
, "\n"
119+
, "This might happen in two cases.\n"
120+
, "\n"
121+
, "1. the clock moved backwards, on restart we ignored everything from the\n"
122+
, " VolatileDB since it's all in the future, and now the tip of the\n"
123+
, " ImmutableDB points to a block produced in the same slot we're trying\n"
124+
, " to produce a block in\n"
125+
, "\n"
126+
, "2. k = 0 and we already adopted a block from another leader of the same\n"
127+
, " slot.\n"
128+
, "\n"
129+
, "We record both the current slot number as well as the tip of the\n"
130+
, "ImmutableDB.\n"
131+
, "\n"
132+
, "See also <https://github.com/input-output-hk/ouroboros-network/issues/1462>"
133+
]
134+
documentFor (Namespace _ ["BlockFromFuture"]) = Just $ mconcat
135+
[ "Leadership check failed: the current chain contains a block from a slot\n"
136+
, "/after/ the current slot\n"
137+
, "\n"
138+
, "This can only happen if the system is under heavy load.\n"
139+
, "\n"
140+
, "We record both the current slot number as well as the slot number of the\n"
141+
, "block at the tip of the chain.\n"
142+
, "\n"
143+
, "See also <https://github.com/input-output-hk/ouroboros-network/issues/1462>"
144+
]
143145
documentFor _ns = Nothing
144146
metricsDocFor (Namespace _ _) = []
145147
allNamespaces = [ Namespace [] ["StartLeadershipCheck"]
@@ -153,8 +155,11 @@ instance LogFormatting (TraceForgeEvent LogBlock) where
153155
(unSlotNo slotNo)
154156
forHuman (TraceSlotIsImmutable slotNo immutableTipPoint immutableTipBlkNo) = pack $
155157
printf
156-
"Couldn't forge block because slot %u is immutable. \
157-
\ Immutable tip: %s, immutable tip block no: %i."
158+
( mconcat
159+
[ "Couldn't forge block because slot %u is immutable. "
160+
, " Immutable tip: %s, immutable tip block no: %i."
161+
]
162+
)
158163
(unSlotNo slotNo)
159164
(show immutableTipPoint)
160165
(unBlockNo immutableTipBlkNo)

trace-dispatcher/src/Cardano/Logging/TraceDispatcherMessage.hs

+12-9
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,18 @@ instance MetaTrace TraceDispatcherMessage where
8181

8282
documentFor (Namespace _ ["StartLimiting"]) = Just
8383
"This message indicates the start of frequency limiting"
84-
documentFor (Namespace _ ["StopLimiting"]) = Just
85-
"This message indicates the stop of frequency limiting,\
86-
\ and gives the number of messages that has been suppressed"
87-
documentFor (Namespace _ ["RememberLimiting"]) = Just
88-
"^ This message remembers of ongoing frequency limiting,\
89-
\ and gives the number of messages that has been suppressed"
90-
documentFor (Namespace _ ["UnknownNamespace"]) = Just
91-
"A value was queried for a namespaces from a tracer,\
92-
\which is unknown. This inicates a bug in the tracer implementation."
84+
documentFor (Namespace _ ["StopLimiting"]) = Just $ mconcat
85+
[ "This message indicates the stop of frequency limiting,"
86+
, " and gives the number of messages that has been suppressed"
87+
]
88+
documentFor (Namespace _ ["RememberLimiting"]) = Just $ mconcat
89+
[ "^ This message remembers of ongoing frequency limiting,"
90+
, " and gives the number of messages that has been suppressed"
91+
]
92+
documentFor (Namespace _ ["UnknownNamespace"]) = Just $ mconcat
93+
[ "A value was queried for a namespaces from a tracer,"
94+
, "which is unknown. This inicates a bug in the tracer implementation."
95+
]
9396

9497
allNamespaces = [
9598
Namespace [] ["StartLimiting"]

0 commit comments

Comments
 (0)