diff options
Diffstat (limited to 'lambda-calcul/haskell/src/Minilang')
| -rw-r--r-- | lambda-calcul/haskell/src/Minilang/Log.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lambda-calcul/haskell/src/Minilang/Log.hs b/lambda-calcul/haskell/src/Minilang/Log.hs index bae4f19..6f871bd 100644 --- a/lambda-calcul/haskell/src/Minilang/Log.hs +++ b/lambda-calcul/haskell/src/Minilang/Log.hs @@ -35,7 +35,7 @@ import Data.Time.Clock diffUTCTime, getCurrentTime, ) -import System.IO (Handle, stdout) +import System.IO (Handle, stdout, hFlush) -- | Environment to control a logger thread. data LoggerEnv m = LoggerEnv @@ -71,6 +71,7 @@ runLog :: TChan BS.ByteString -> Handle -> IO a runLog chan hdl = forever $ do toLog <- atomically $ readTChan chan BS.hPutStr hdl . (<> "\n") $ toLog + hFlush hdl stopLogger' :: (MonadIO m) => Async () -> m () stopLogger' = liftIO . cancel |
