diff options
Diffstat (limited to 'Omni/Agent/Log.hs')
| -rw-r--r-- | Omni/Agent/Log.hs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Omni/Agent/Log.hs b/Omni/Agent/Log.hs index 07770d0..c78dc4b 100644 --- a/Omni/Agent/Log.hs +++ b/Omni/Agent/Log.hs @@ -2,10 +2,11 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE NoImplicitPrelude #-} --- : out omni-agent-log +-- | Status of the agent for the UI module Omni.Agent.Log where import Alpha +import Control.Applicative ((<$>), (<*>)) import Data.Aeson ((.:), (.:?)) import qualified Data.Aeson as Aeson import qualified Data.ByteString.Lazy as BL @@ -133,17 +134,15 @@ data LogEntry = LogEntry instance Aeson.FromJSON LogEntry where parseJSON = Aeson.withObject "LogEntry" <| \v -> - LogEntry - </ v - .: "message" + (LogEntry </ (v .: "message")) <*> v - .:? "threadId" + .:? "threadId" <*> v - .:? "credits" + .:? "credits" <*> v - .:? "totalCredits" + .:? "totalCredits" <*> v - .:? "timestamp" + .:? "timestamp" -- | Parse a log line and update status processLogLine :: Text -> IO () |
