From 3a4b33c0a526c958c447ce6820b0ba11fb0a7c4c Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Wed, 12 Feb 2014 18:40:48 +0400 Subject: Enable logging in simpleClient function --- src/Network/BitTorrent/Client.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Network/BitTorrent/Client.hs b/src/Network/BitTorrent/Client.hs index 255c4dec..c6b4901a 100644 --- a/src/Network/BitTorrent/Client.hs +++ b/src/Network/BitTorrent/Client.hs @@ -36,6 +36,7 @@ module Network.BitTorrent.Client import Control.Exception import Control.Concurrent +import Control.Monad.Logger import Control.Monad.Trans.Resource import Data.Default @@ -117,6 +118,6 @@ withClient opts lf action = bracket (newClient opts lf) closeClient action -- For testing purposes only. -- simpleClient :: BitTorrent () -> IO () -simpleClient m = withClient def logger (`runBitTorrent` m) - where - logger _ _ _ _ = return () \ No newline at end of file +simpleClient m = do + runStderrLoggingT $ LoggingT $ \ logger -> do + withClient def logger (`runBitTorrent` m) -- cgit v1.2.3