From f3539856541e07ec38b1eb3678f77a39b3b8c7db Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 4 Aug 2022 09:48:10 -0400 Subject: Improve bild logging --- Biz/Log.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Biz/Log.hs') 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 = ": " -- cgit v1.2.3