From f57e800a1d1a8e9f2bed34428f7f58a375f178fb Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 11 Jul 2021 17:56:34 +0200 Subject: WIP splitting of Target module and towards parallel builds --- Coolbal/Log.hs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Coolbal/Log.hs (limited to 'Coolbal/Log.hs') diff --git a/Coolbal/Log.hs b/Coolbal/Log.hs new file mode 100644 index 0000000..d09ad7b --- /dev/null +++ b/Coolbal/Log.hs @@ -0,0 +1,21 @@ +module Coolbal.Log ( + logw, + logVerbose, +) where + +import System.IO (hPutStrLn, stderr) + +import Coolbal.Options + + +logw :: Flags -> Verbosity -> String -> String -> IO () +logw Flags{fVerbosity=verb} level key line + | verb >= level = doLog key line + | otherwise = return () + +logVerbose :: Flags -> String -> String -> IO () +logVerbose flags key line = logw flags Verbose key line + +doLog :: String -> String -> IO () +doLog key line = + hPutStrLn stderr ("[coolbal:" ++ key ++ "] " ++ line) -- cgit v1.2.3-70-g09d2