diff options
Diffstat (limited to 'Omni/Log')
| -rw-r--r-- | Omni/Log/Concurrent.hs | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/Omni/Log/Concurrent.hs b/Omni/Log/Concurrent.hs index 391fcff..204e497 100644 --- a/Omni/Log/Concurrent.hs +++ b/Omni/Log/Concurrent.hs @@ -89,11 +89,7 @@ withLineManager maxLines action = do result <- action mgr - forM_ [0 .. maxLines - 1] <| \_ -> do - ANSI.hCursorDown IO.stderr 1 - ANSI.hSetCursorColumn IO.stderr 0 - ANSI.hClearLine IO.stderr - + ANSI.hCursorDown IO.stderr maxLines writeIORef currentLineManager Nothing writeIORef namespaceLines Map.empty pure result @@ -122,19 +118,7 @@ reserveLine LineManager {..} ns = linesMap' = Map.insert lineNum (Just status) linesMap in (linesMap', Just lineNum) case mLine of - Just lineNum -> do - modifyIORef' namespaceLines (Map.insert ns lineNum) - currentLine <- readIORef lmCurrentLine - ANSI.hSaveCursor IO.stderr - ANSI.hSetCursorColumn IO.stderr 0 - let linesToMove = currentLine - lineNum - when (linesToMove > 0) <| ANSI.hCursorUp IO.stderr linesToMove - when (linesToMove < 0) <| ANSI.hCursorDown IO.stderr (abs linesToMove) - ANSI.hClearLine IO.stderr - let nsText = Text.pack (Namespace.toPath ns) - IO.hPutStr IO.stderr (Text.unpack <| "[+] " <> nsText) - IO.hFlush IO.stderr - ANSI.hRestoreCursor IO.stderr + Just lineNum -> modifyIORef' namespaceLines (Map.insert ns lineNum) Nothing -> pure () pure mLine where |
