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)