From 1c65905502df013ab0076726aa919b91c14d7a4c Mon Sep 17 00:00:00 2001 From: James Crayne Date: Tue, 29 May 2018 03:36:02 +0000 Subject: dput: suppressible debug prints --- src/Network/Tox/Onion/Handlers.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Network/Tox/Onion/Handlers.hs') diff --git a/src/Network/Tox/Onion/Handlers.hs b/src/Network/Tox/Onion/Handlers.hs index 8c3a9a86..94ece8ab 100644 --- a/src/Network/Tox/Onion/Handlers.hs +++ b/src/Network/Tox/Onion/Handlers.hs @@ -43,6 +43,7 @@ import Data.Maybe import Data.Bits import Data.Ord import Data.Functor.Identity +import DPut type Client r = QR.Client String PacketKind TransactionId (OnionDestination r) Message type Message = OnionMessage Identity @@ -77,7 +78,7 @@ announceH routing toks keydb oaddr req = do _ -> let Nonce32 bs = announcePingId req tok = fromPaddedByteString 32 bs in checkToken toks (onionNodeInfo oaddr) tok >>= go - `catch` (\(SomeException e) -> hPutStrLn stderr ("announceH Exception! "++show e) >> throw e) + `catch` (\(SomeException e) -> dput XAnnounce ("announceH Exception! "++show e) >> throw e) where go withTok = do let naddr = onionNodeInfo oaddr @@ -87,7 +88,7 @@ announceH routing toks keydb oaddr req = do let storing = case oaddr of OnionToOwner _ pth -> guard (nodeId naddr == announceSeeking req) >> Just pth _ -> Nothing - hPutStrLn stderr $ unlines [ "announceH: nodeId = " ++ show (nodeId naddr) + dput XAnnounce $ unlines [ "announceH: nodeId = " ++ show (nodeId naddr) , " announceSeeking = " ++ show (announceSeeking req) , " withTok = " ++ show withTok , " storing = " ++ maybe "False" (const "True") storing -- cgit v1.2.3