summaryrefslogtreecommitdiff
path: root/Biz/Log.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-08-04 09:48:10 -0400
committerBen Sima <ben@bsima.me>2022-08-04 09:48:10 -0400
commitf3539856541e07ec38b1eb3678f77a39b3b8c7db (patch)
tree2b30769e24e1a673de0777659b3dac072a3a24d2 /Biz/Log.hs
parent7b89187e865716bd20bf41c998e30bc91fa3f0b7 (diff)
Improve bild logging
Diffstat (limited to 'Biz/Log.hs')
-rw-r--r--Biz/Log.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Biz/Log.hs b/Biz/Log.hs
index 286e00a..d398f4b 100644
--- a/Biz/Log.hs
+++ b/Biz/Log.hs
@@ -23,6 +23,7 @@ module Biz.Log
-- * Low-level
msg,
+ fmt,
br,
)
where
@@ -57,7 +58,7 @@ msg lvl labels =
where
-- For systemd-journal, emacs *compilation* buffers, etc.
putDumb = putStr <| txt <> "\n"
- txt = Text.intercalate gap (label : labels)
+ txt = fmt (label : labels)
(color, label) = case lvl of
Good -> (green, "good")
Pass -> (green, "pass")
@@ -67,6 +68,10 @@ msg lvl labels =
Mark -> (magenta, "mark")
clear = "\ESC[2K"
+-- | Helper function for formatting outputs of labels.
+fmt :: [Text] -> Text
+fmt = Text.intercalate gap
+
gap :: Text
gap = ": "