From 54ffbdc61c63a75c988c990909bab1c007b19e0c Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 1 May 2020 01:50:01 +0200 Subject: Main.app: do formatting in log producer --- src/main.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.hs b/src/main.hs index de86355..f1016f2 100644 --- a/src/main.hs +++ b/src/main.hs @@ -53,13 +53,13 @@ app client = do hSetBuffering cLogHandle LineBuffering logToTTY <- hIsTerminalDevice cLogHandle - (putLog, takeLog0) <- newChan + (putLog0, takeLog) <- newChan let - takeLog1 = if cLogTime then takeLog0 >>= prefixTimestamp else takeLog0 - takeLog2 = showUnprintable <$> takeLog1 - takeLog3 = if logToTTY then takeLog2 else stripSGR <$> takeLog2 - takeLog = takeLog3 + putLog1 = if cLogTime then (putLog0 =<<) . prefixTimestamp else putLog0 + putLog2 = putLog1 . showUnprintable + putLog3 = if logToTTY then putLog2 else putLog2 . stripSGR + putLog = putLog3 _ <- addMatch client matchAny $ \case -- cgit v1.2.3