-- cgit v1.2.3 From de5fad970ee26d334f226275ecde6904b1f13b6d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Jan 2015 19:37:51 -0400 Subject: propellor spin --- src/Propellor/Protocol.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs index 95a671bc..2c568817 100644 --- a/src/Propellor/Protocol.hs +++ b/src/Propellor/Protocol.hs @@ -41,6 +41,7 @@ fromMarked marker s sendMarked :: Handle -> Marker -> String -> IO () sendMarked h marker s = do + debug ["sent req", marker] -- Prefix string with newline because sometimes a -- incomplete line has been output, and the marker needs to -- come at the start of a line. -- cgit v1.2.3 From 6250b057670c067642f090157d937f40e212f7dd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Jan 2015 19:40:27 -0400 Subject: improve protocol debugging --- src/Propellor/Protocol.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs index 2c568817..940f3e67 100644 --- a/src/Propellor/Protocol.hs +++ b/src/Propellor/Protocol.hs @@ -41,7 +41,7 @@ fromMarked marker s sendMarked :: Handle -> Marker -> String -> IO () sendMarked h marker s = do - debug ["sent req", marker] + debug ["sent marked", marker] -- Prefix string with newline because sometimes a -- incomplete line has been output, and the marker needs to -- come at the start of a line. @@ -57,7 +57,9 @@ getMarked h marker = go =<< catchMaybeIO (hGetLine h) unless (null l) $ hPutStrLn stderr l getMarked h marker - Just v -> return (Just v) + Just v -> do + debug ["received marked", marker] + return (Just v) req :: Stage -> Marker -> (String -> IO ()) -> IO () req stage marker a = do -- cgit v1.2.3 -- cgit v1.2.3 From bd7c118caea362005c7dbdea5d6fd3da1d98fe9a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Jan 2015 19:42:59 -0400 Subject: propellor spin --- src/Propellor/Protocol.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs index 940f3e67..b6d38d06 100644 --- a/src/Propellor/Protocol.hs +++ b/src/Propellor/Protocol.hs @@ -42,6 +42,10 @@ fromMarked marker s sendMarked :: Handle -> Marker -> String -> IO () sendMarked h marker s = do debug ["sent marked", marker] + sendMarked' h marker s + +sendMarked' :: Handle -> Marker -> String -> IO () +sendMarked' h marker s = do -- Prefix string with newline because sometimes a -- incomplete line has been output, and the marker needs to -- come at the start of a line. @@ -63,5 +67,6 @@ getMarked h marker = go =<< catchMaybeIO (hGetLine h) req :: Stage -> Marker -> (String -> IO ()) -> IO () req stage marker a = do - sendMarked stdout statusMarker (show stage) + debug ["requested marked", marker] + sendMarked' stdout statusMarker (show stage) maybe noop a =<< getMarked stdin marker -- cgit v1.2.3