summaryrefslogtreecommitdiff
path: root/Logs/Presence.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Logs/Presence.hs')
-rw-r--r--Logs/Presence.hs7
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