diff options
author | 2012-01-06 17:51:01 -0400 | |
---|---|---|
committer | 2012-01-06 17:51:01 -0400 | |
commit | 6055a95c6f55410e010ace1b93268d70318e07dd (patch) | |
tree | 7fcad82a1c0e55c4d9fe09b819447440d2719e9a /Logs/Presence.hs | |
parent | bc59da72501db1cfac69315798a7359037bb9002 (diff) | |
parent | 3c88d573990d79a5a964567c4a16068ef5ecfa0f (diff) |
Merge branch 'wip'
Diffstat (limited to 'Logs/Presence.hs')
-rw-r--r-- | Logs/Presence.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Logs/Presence.hs b/Logs/Presence.hs index f5e4f1ea9..372af37d5 100644 --- a/Logs/Presence.hs +++ b/Logs/Presence.hs @@ -13,14 +13,15 @@ module Logs.Presence ( LogStatus(..), + LogLine, addLog, readLog, + getLog, parseLog, showLog, logNow, compactLog, currentLog, - LogLine ) where import Data.Time.Clock.POSIX @@ -80,6 +81,10 @@ logNow s i = do currentLog :: FilePath -> Annex [String] currentLog file = map info . filterPresent <$> readLog file +{- Given a log, returns only the info that is are still in effect. -} +getLog :: String -> [String] +getLog = map info . filterPresent . parseLog + {- Returns the info from LogLines that are in effect. -} filterPresent :: [LogLine] -> [LogLine] filterPresent = filter (\l -> InfoPresent == status l) . compactLog |