@@ -178,14 +178,16 @@ withExitFailMessage msg f = f `catch` \(e :: ExitCode) -> do
178178
179179-- | Write log to stdout, with colors (unless `noColor`)
180180writeLog :: (MonadIO m, MonadMask m) => Bool -> Bool -> WithSeverity Text -> m ()
181−writeLog withNewLine noColor (WithSeverity severity s)
182− | noColor && severity <= Warning = liftIO $ putFn $ T.pack (show severity) <> ": " <> s
183− | not noColor && severity <= Error = TS.putStrWithSGR errorColors h withNewLine s
184− | not noColor && severity <= Warning = TS.putStrWithSGR warningColors h withNewLine s
185− | not noColor && severity >= Debug = TS.putStrWithSGR debugColors h withNewLine s
186− | otherwise = liftIO $ putFn s
181+writeLog withNewLine noColor (WithSeverity severity s) = if T.null s then pure () else write
187182 where
188− putFn = if withNewLine then (T.hPutStrLn h) else (T.hPutStr h)
183+ write
184+ | noColor && severity <= Warning = liftIO $ putFn $ T.pack (show severity) <> ": " <> s
185+ | not noColor && severity <= Error = TS.putStrWithSGR errorColors h withNewLine s
186+ | not noColor && severity <= Warning = TS.putStrWithSGR warningColors h withNewLine s
187+ | not noColor && severity >= Debug = TS.putStrWithSGR debugColors h withNewLine s
188+ | otherwise = liftIO $ putFn s
189+
190+ putFn = if withNewLine then T.hPutStrLn h else T.hPutStr h
189191 h = if severity <= Error then stderr else stdout
190192 errorColors = [SetColor Foreground Vivid Red]
191193 warningColors = [SetColor Foreground Vivid Yellow]