diff options
Diffstat (limited to 'Biz/Log.hs')
-rw-r--r-- | Biz/Log.hs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,7 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} --- : dep rainbow module Biz.Log ( Lvl (..), good, @@ -44,7 +43,7 @@ msg lvl labels = -- systemd doesn't render msgs produced by putChunk, so when live we don't -- use rainbow at all "Live" -> putStr txt - _ -> Rainbow.putChunk <| fore color <| clear <> chunk txt <> "\r" + _ -> Rainbow.hPutChunks IO.stderr [fore color <| clear <> chunk txt <> "\r"] where txt = Text.intercalate gap (label : labels) (color, label) = case lvl of @@ -60,7 +59,7 @@ gap :: Text gap = ": " br :: IO () -br = Rainbow.putChunk "\n" >> IO.hFlush stdout +br = Rainbow.hPutChunks stderr ["\n"] >> IO.hFlush stderr good, pass, info, warn, fail :: [Text] -> IO () good = msg Good @@ -74,12 +73,13 @@ mark :: Show a => Text -> a -> a mark label val = unsafePerformIO <| do msg Mark [label, tshow val] + br pure val -- | Pipelined version of 'mark'. -- -- @ --- mark label val = val ~| label +-- mark label val = val ~& label -- @ (~&) :: Show a => a -> Text -> a (~&) val label = mark label val |