diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/StartLeadershipCheck.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/StartLeadershipCheck.hs index a6ee7048fe2..b3d5bb810a9 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/StartLeadershipCheck.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/StartLeadershipCheck.hs @@ -4,7 +4,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PackageImports #-} module Cardano.Node.Tracing.Tracers.StartLeadershipCheck ( TraceStartLeadershipCheckPlus (..) diff --git a/cardano-tracer/src/Cardano/Tracer/MetaTrace.hs b/cardano-tracer/src/Cardano/Tracer/MetaTrace.hs index cc32462ed4f..9bba731ac17 100644 --- a/cardano-tracer/src/Cardano/Tracer/MetaTrace.hs +++ b/cardano-tracer/src/Cardano/Tracer/MetaTrace.hs @@ -155,7 +155,7 @@ instance MetaTrace TracerTrace where ] stderrShowTracer :: Trace IO TracerTrace -stderrShowTracer = Trace $ T.arrow $ T.emit $ +stderrShowTracer = Trace $ T.arrow $ T.emit (either (const $ pure ()) (Sys.hPrint Sys.stderr) . snd) stderrTracer :: Trace IO FormattedMessage diff --git a/trace-dispatcher/src/Cardano/Logging/Formatter.hs b/trace-dispatcher/src/Cardano/Logging/Formatter.hs index 474f9117087..0282d332775 100644 --- a/trace-dispatcher/src/Cardano/Logging/Formatter.hs +++ b/trace-dispatcher/src/Cardano/Logging/Formatter.hs @@ -36,7 +36,7 @@ import Network.HostName encodingToText :: AE.Encoding -> Text -{-# INLINE encodingToText#-} +{-# INLINE encodingToText #-} encodingToText = toStrict . decodeUtf8 . AE.encodingToLazyByteString -- | Format this trace as metrics diff --git a/trace-dispatcher/src/Cardano/Logging/Trace.hs b/trace-dispatcher/src/Cardano/Logging/Trace.hs index 0fb10e9a25c..110ec99d335 100644 --- a/trace-dispatcher/src/Cardano/Logging/Trace.hs +++ b/trace-dispatcher/src/Cardano/Logging/Trace.hs @@ -37,7 +37,7 @@ module Cardano.Logging.Trace ( , withInnerNames ) where -import Control.Monad (join) +import Control.Monad (forM_, join) import Control.Monad.IO.Unlift import qualified Control.Tracer as T import Data.Maybe (isJust) @@ -307,9 +307,7 @@ contramapMCond (Trace tr) mFunc = where rFunc arg = do condMes <- mFunc arg - case condMes of - Nothing -> pure () - Just mes -> T.traceWith tr mes + forM_ condMes (T.traceWith tr) {-# INLINE contramapM' #-} contramapM' :: Monad m