From 604b736a8feac6736c4e01a85e0983699ebb1b6d Mon Sep 17 00:00:00 2001 From: Haskell Guy Date: Thu, 28 May 2020 12:40:39 +0200 Subject: Make slightly less verbose Remove not needed printing to stdout and replace 'print's with putStrLn to avoid surrounding output with quotation marks. --- src/Ssb/Peer/RPC/Gossip.hs | 2 +- src/Ssb/Peer/RPC/Room.hs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Ssb/Peer/RPC') diff --git a/src/Ssb/Peer/RPC/Gossip.hs b/src/Ssb/Peer/RPC/Gossip.hs index b97e4a4..80e1aac 100644 --- a/src/Ssb/Peer/RPC/Gossip.hs +++ b/src/Ssb/Peer/RPC/Gossip.hs @@ -115,7 +115,7 @@ writeFeed stream (Feed.Feed _ msgs) = do (\msg -> do let msg' = Feed.encodeJSONVerifiableMessage msg err <- RPC.writeStream stream def (RPC.JSONPayload msg') - either (\err -> print err) (\_ -> return ()) err + either (\err -> putStrLn err) (\_ -> return ()) err ) instance ToJSON a => RPC.Handler (Gossiper a) where diff --git a/src/Ssb/Peer/RPC/Room.hs b/src/Ssb/Peer/RPC/Room.hs index 47bc956..0b85414 100644 --- a/src/Ssb/Peer/RPC/Room.hs +++ b/src/Ssb/Peer/RPC/Room.hs @@ -149,7 +149,6 @@ fork mVar action = do forkFinally action (\_ -> do - print "exiting fork" atomically $ putTMVar fork' () ) @@ -185,11 +184,6 @@ createTunnel :: Room -> (RPC.Stream, RPC.Stream) -> IO (Either Text ()) createTunnel room (stream1, stream2) = do let peer1 = RPC.connPeer $ RPC.conn stream1 let peer2 = RPC.connPeer $ RPC.conn stream2 - --print - -- $ "creating tunnel for " - -- <> Ssb.formatPublicKey peer1 - -- <> " <-> " - -- <> Ssb.formatPublicKey peer2 let tunnel = newTunnel peer1 peer2 exists <- atomically $ do @@ -243,7 +237,7 @@ connect room stream req = do maybeToRight errPeerNotAvailable mPeer case peerConn of Left err -> do - print $ "errorr! " <> err + putStrLn $ "room error: " <> err return $ Left err Right conn -> RPC.request conn (rpcRequest req) $ \peerStream -> createTunnel room (stream, peerStream) -- cgit v1.2.3