summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-05-01 01:50:01 +0200
committertv <tv@krebsco.de>2020-05-01 01:50:01 +0200
commit54ffbdc61c63a75c988c990909bab1c007b19e0c (patch)
tree35f6e9ab019e55d5e4aae8a08b9beae2929a13f8 /src
parentf0e8d1b9041662ec07eae33d3c03109e2abcf6e8 (diff)
Main.app: do formatting in log producer
Diffstat (limited to 'src')
-rw-r--r--src/main.hs10
1 files 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