aboutsummaryrefslogtreecommitdiff
path: root/src/executable/haskell/Conf.hs
diff options
context:
space:
mode:
authorJoris2019-09-09 20:42:41 +0200
committerJoris2019-09-09 20:42:41 +0200
commit88a2f0c22b523dd5246cefaeefd6c08bf9d6fba7 (patch)
treea138ceec2036313bc81b4ab2b0685914ee166c29 /src/executable/haskell/Conf.hs
parent3e2c3f014bce0a82ac8708925806be05412898f9 (diff)
downloadad-listener-88a2f0c22b523dd5246cefaeefd6c08bf9d6fba7.tar.gz
ad-listener-88a2f0c22b523dd5246cefaeefd6c08bf9d6fba7.tar.bz2
ad-listener-88a2f0c22b523dd5246cefaeefd6c08bf9d6fba7.zip
Use logging library instead of putStrLn
Diffstat (limited to 'src/executable/haskell/Conf.hs')
-rw-r--r--src/executable/haskell/Conf.hs5
1 files changed, 4 insertions, 1 deletions
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)