diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-22 11:41:54 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-22 11:41:54 -0400 |
commit | 362d3a437c16c10d221caeac21e9f685d7ddf3e6 (patch) | |
tree | 89e8ca2a63bebd6355c4d6b163592e538ba2eced /Replay.hs | |
parent | db4e4c47898c0bb3dab27ee82ca563e37aaf62ea (diff) | |
download | debug-me-362d3a437c16c10d221caeac21e9f685d7ddf3e6.tar.gz |
stream the log
avoid processing it in memory, and allow parse errors at end to not
prevent displaying part of it
Diffstat (limited to 'Replay.hs')
-rw-r--r-- | Replay.hs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -10,10 +10,10 @@ import System.IO import Control.Concurrent.Thread.Delay replay :: ReplayOpts -> IO () -replay opts = go Nothing =<< loadLog (replayLogFile opts) +replay opts = go Nothing =<< streamLog (replayLogFile opts) where go _ [] = sessionDone - go prevts (l:ls) = do + go prevts (Right l:ls) = do case prevts of Nothing -> return () Just t -> @@ -28,3 +28,4 @@ replay opts = go Nothing =<< loadLog (replayLogFile opts) User (ControlMessage _) -> return () Developer _ -> return () go (Just $ loggedTimestamp l) ls + go _ (Left l:_) = error $ "Failed to parse a line of the log: " ++ l |