summaryrefslogtreecommitdiff
path: root/src/DPut.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DPut.hs')
-rw-r--r--src/DPut.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/DPut.hs b/src/DPut.hs
index 84f086b3..52714086 100644
--- a/src/DPut.hs
+++ b/src/DPut.hs
@@ -1,5 +1,6 @@
1module DPut where 1module DPut where
2 2
3import Control.Monad.IO.Class
3import Control.Concurrent.STM 4import Control.Concurrent.STM
4import qualified Data.Map.Strict as Map 5import qualified Data.Map.Strict as Map
5import System.IO (stderr,hPutStrLn) 6import System.IO (stderr,hPutStrLn)
@@ -20,11 +21,11 @@ appName = "toxmpp"
20(<.>) :: String -> String -> String 21(<.>) :: String -> String -> String
21a <.> b = a ++ "." ++ b 22a <.> b = a ++ "." ++ b
22 23
23dput :: DebugTag -> String -> IO () 24dput :: MonadIO m => DebugTag -> String -> m ()
24dput tag msg = debugM (appName <.> show tag) msg 25dput tag msg = liftIO $ debugM (appName <.> show tag) msg
25 26
26dputB :: DebugTag -> B.ByteString -> IO () 27dputB :: MonadIO m => DebugTag -> B.ByteString -> m ()
27dputB tag msg = debugM (appName <.> show tag) (T.unpack . T.decodeUtf8 $ msg) 28dputB tag msg = liftIO $ debugM (appName <.> show tag) (T.unpack . T.decodeUtf8 $ msg)
28 29
29setTagLevel :: Priority -> DebugTag -> IO () 30setTagLevel :: Priority -> DebugTag -> IO ()
30setTagLevel level tag = updateGlobalLogger (appName <.> show tag) (setLevel level) 31setTagLevel level tag = updateGlobalLogger (appName <.> show tag) (setLevel level)