From 88a2f0c22b523dd5246cefaeefd6c08bf9d6fba7 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 9 Sep 2019 20:42:41 +0200 Subject: Use logging library instead of putStrLn --- src/executable/haskell/Conf.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/executable/haskell/Conf.hs') diff --git a/src/executable/haskell/Conf.hs b/src/executable/haskell/Conf.hs index 0dc857b..53a1046 100644 --- a/src/executable/haskell/Conf.hs +++ b/src/executable/haskell/Conf.hs @@ -3,6 +3,7 @@ module Conf , Conf(..) ) where +import qualified Control.Logging as Logging import qualified Data.ConfigManager as Conf import Data.Text (Text) import qualified Data.Text as T @@ -21,6 +22,7 @@ data Conf = Conf , listenTo :: DiffTime , listenInterval :: DiffTime , listenIntervalNoise :: DiffTime + , logLevel :: Logging.LogLevel } deriving Show parse :: FilePath -> IO Conf @@ -38,7 +40,8 @@ parse path = do Conf.lookup "listenFrom" conf <*> Conf.lookup "listenTo" conf <*> Conf.lookup "listenInterval" conf <*> - Conf.lookup "listenIntervalNoise" conf + Conf.lookup "listenIntervalNoise" conf <*> + Conf.lookup "logLevel" conf ) case conf of Left msg -> error (T.unpack msg) -- cgit v1.2.3