summaryrefslogtreecommitdiff
path: root/Omni/Agent/Log.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Agent/Log.hs')
-rw-r--r--Omni/Agent/Log.hs24
1 files changed, 15 insertions, 9 deletions
diff --git a/Omni/Agent/Log.hs b/Omni/Agent/Log.hs
index 33b9722..c93479b 100644
--- a/Omni/Agent/Log.hs
+++ b/Omni/Agent/Log.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
@@ -26,14 +25,21 @@ data LogEntry = LogEntry
deriving (Show, Eq, Generic)
instance FromJSON LogEntry where
- parseJSON = Aeson.withObject "LogEntry" <| \v ->
- LogEntry
- <$> v .: "message"
- <*> v .:? "level"
- <*> v .:? "toolName"
- <*> v .:? "batches"
- <*> v .:? "method"
- <*> v .:? "path"
+ parseJSON =
+ Aeson.withObject "LogEntry" <| \v ->
+ ( LogEntry
+ </ (v .: "message")
+ )
+ <*> v
+ .:? "level"
+ <*> v
+ .:? "toolName"
+ <*> v
+ .:? "batches"
+ <*> v
+ .:? "method"
+ <*> v
+ .:? "path"
parseLine :: Text -> Maybe LogEntry
parseLine line = Aeson.decode <| BSL.fromStrict <| encodeUtf8 line