diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-09-16 09:49:21 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-09-16 09:49:21 +0200 |
commit | 1ed636f013cad12ab74f5fcd264280d7504ab951 (patch) | |
tree | a834c117cdfc2c93d1fc04a240f411440a68aa0d | |
parent | 5976161a7649cca7cd56d4335316179031a364ab (diff) |
Some extra debug prints
-rw-r--r-- | src/Ghci.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Ghci.hs b/src/Ghci.hs index 85081c5..d16d2a0 100644 --- a/src/Ghci.hs +++ b/src/Ghci.hs @@ -214,11 +214,11 @@ hGetUntil h mmax tag = do when (nread <= 0) $ exitEarly (BSB.toLazyByteString builder, ReachedEOF) bs <- lift $ BS.packCStringLen (ptr, nread) - -- lift $ putStrLn ("Read: " ++ show bs) + when debugPrints $ lift $ hPutStrLn stderr ("Read: " ++ show bs) when (or [BSS.toShort (BS.takeEnd suflen bs) == BSS.takeEnd suflen tag | n <- 0 : havePrefixes , let suflen = BSS.length tag - n]) $ do - -- lift $ putStrLn "yay determined end" + when debugPrints $ lift $ hPutStrLn stderr "yay determined end" exitEarly (BSB.toLazyByteString (builder <> BSB.byteString bs) ,ReachedTag) @@ -232,7 +232,7 @@ hGetUntil h mmax tag = do [n -- new matches | n <- [1 .. min (BS.length bs) (BSS.length tag)] , BSS.toShort (BS.takeEnd n bs) == BSS.take n tag] - -- lift $ putStrLn ("nextPrefixes = " ++ show nextPrefixes) + when debugPrints $ lift $ hPutStrLn stderr ("nextPrefixes = " ++ show nextPrefixes) loop (yet + nread) nextPrefixes (builder <> BSB.byteString bs) result <- execExitEarlyT (loop 0 [] mempty) when debugPrints $ hPutStrLn stderr ("Read: <" ++ show result ++ ">") |