diff options
Diffstat (limited to 'Biz')
-rw-r--r-- | Biz/Log.hs | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} @@ -47,11 +48,14 @@ area = msg :: Lvl -> [Text] -> IO () msg lvl labels = case area of - -- systemd doesn't render msgs produced by putChunk, so when live we don't - -- use rainbow at all - "Live" -> putStr txt - _ -> Rainbow.hPutChunks IO.stderr [fore color <| clear <> chunk txt <> "\r"] + "Live" -> putDumb + _ -> + Env.getEnv "TERM" +> \case + "dumb" -> putDumb + _ -> Rainbow.hPutChunks IO.stderr [fore color <| clear <> chunk txt <> "\r"] where + -- For systemd-journal, emacs *compilation* buffers, etc. + putDumb = putStr <| txt <> "\n" txt = Text.intercalate gap (label : labels) (color, label) = case lvl of Good -> (green, "good") |