setpresentkey: A new plumbing-level command.
This commit is contained in:
parent
589a048a7d
commit
43dc7f678f
5 changed files with 50 additions and 4 deletions
|
@ -30,14 +30,16 @@ parseLog = mapMaybe parseline . lines
|
|||
where
|
||||
parseline l = LogLine
|
||||
<$> (utcTimeToPOSIXSeconds <$> parseTime defaultTimeLocale "%s%Qs" d)
|
||||
<*> parsestatus s
|
||||
<*> parseStatus s
|
||||
<*> pure rest
|
||||
where
|
||||
(d, pastd) = separate (== ' ') l
|
||||
(s, rest) = separate (== ' ') pastd
|
||||
parsestatus "1" = Just InfoPresent
|
||||
parsestatus "0" = Just InfoMissing
|
||||
parsestatus _ = Nothing
|
||||
|
||||
parseStatus :: String -> Maybe LogStatus
|
||||
parseStatus "1" = Just InfoPresent
|
||||
parseStatus "0" = Just InfoMissing
|
||||
parseStatus _ = Nothing
|
||||
|
||||
{- Generates a log file. -}
|
||||
showLog :: [LogLine] -> String
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue