From 971a56735cddf95aa11cd540ec362fd5e56e1205 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 14 Jun 2022 18:57:39 +0200 Subject: More logging --- src/Ghci.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/Ghci.hs b/src/Ghci.hs index fbbaa65..13eb4ca 100644 --- a/src/Ghci.hs +++ b/src/Ghci.hs @@ -62,6 +62,7 @@ runStmtClever ghci line = | "def" `startsWith` cmd -> return (ghci, Ignored) | "quit" `startsWith` cmd -> do terminateGhci ghci + putStrLn "ghci: restarting due to :quit" ghci' <- makeGhci return (ghci', Return "") _ -> runStmt ghci line @@ -78,11 +79,13 @@ restarting numExcRestarts f ghci = do closed <- hIsClosed (ghciStdin ghci) ghci' <- if closed then do + putStrLn "ghci: restarting due to closed stdin" terminateGhci ghci makeGhci else return ghci (f ghci' >>= \x -> return (ghci', Return x)) `catch` (\e -> do let _ = e :: SomeException + putStrLn $ "ghci: restarting due to exception: " ++ show e terminateGhci ghci' ghci'' <- makeGhci if numExcRestarts >= 1 -- cgit v1.2.3-70-g09d2