Browse Source

Fix timestamps

master
Denis Tereshkin 6 years ago
parent
commit
18d8fe0a50
  1. 7
      src/Main.hs

7
src/Main.hs

@ -84,11 +84,12 @@ runWithConfig config = do @@ -84,11 +84,12 @@ runWithConfig config = do
(_, Just stdOut, Just stdErr, ph) <- createProcess $ (proc (cExecutablePath execcfg) (makeArgs (cGlobalArgs config) (cArgs execcfg))) { std_out = CreatePipe, std_err = CreatePipe }
withFile (cLogPath execcfg) AppendMode $ \log -> handleIO (exceptionHandler inChan) $ do
stdErrLogThread <- forkIO $ forever $ do
line <- T.pack <$> hGetLine stdErr
now <- getCurrentTime
line <- lineWithTime now . T.pack <$> hGetLine stdErr
TIO.hPutStrLn log line
let line' = lineWithTime now line
TIO.hPutStrLn log line'
hFlush log
writeChan inChan line
writeChan inChan line'
forever $ do
now <- getCurrentTime
line <- lineWithTime now . T.pack <$> hGetLine stdOut

Loading…
Cancel
Save