summaryrefslogtreecommitdiffhomepage
path: root/Log.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-27 09:39:55 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-27 09:47:07 -0400
commit937b55549b4ba72b0392d7e139e592a40eec2101 (patch)
treed11a33aff3bd54c6bc66058028657915481181de /Log.hs
parentc13c732ac4174dca2341a8b3ea84582c01ce5cde (diff)
downloaddebug-me-937b55549b4ba72b0392d7e139e592a40eec2101.tar.gz
rename LogMessage to AnyMessage
Not related to the Log anymore.
Diffstat (limited to 'Log.hs')
-rw-r--r--Log.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Log.hs b/Log.hs
index 948ab19..ffb4eb7 100644
--- a/Log.hs
+++ b/Log.hs
@@ -20,7 +20,7 @@ import System.IO
-- Note that changing this in ways that change the JSON serialization
-- changes debug-me's log file format.
data Log = Log
- { loggedMessage :: LogMessage
+ { loggedMessage :: AnyMessage
, loggedHash :: Maybe Hash
, loggedTimestamp :: Timestamp
}
@@ -34,7 +34,7 @@ instance DataSize Log where
instance ToJSON Log
instance FromJSON Log
-mkLog :: LogMessage -> POSIXTime -> Log
+mkLog :: AnyMessage -> POSIXTime -> Log
mkLog m now = Log
{ loggedMessage = m
, loggedHash = case m of
@@ -47,7 +47,7 @@ mkLog m now = Log
type Timestamp = POSIXTime
-type Logger = LogMessage -> IO ()
+type Logger = AnyMessage -> IO ()
withLogger :: FilePath -> (Logger -> IO a) -> IO a
withLogger logfile a = withFile logfile WriteMode (a . mkLogger)