diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-26 16:15:43 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-26 16:18:01 -0400 |
commit | 52f9c68869fa8956db55980f0b36ba817f825ffb (patch) | |
tree | b288b73ee5766a0048b1e2d593a0d0ec130044c0 /Role/Watcher.hs | |
parent | 62f7653e39e95d3e9cd308810e487e3cdee84d52 (diff) | |
download | debug-me-52f9c68869fa8956db55980f0b36ba817f825ffb.tar.gz |
include elapsedTime in Activity
Time is relative, so the debug-me proof chain doesn't prove when things
happened, but it's still useful to have some idea of how long things
took to happen. This makes --replay work with logs gotten by --download.
Log still includes loggedTimestamp. This is a bit redundant, and is
unused now, but it's useful for log files to record when messages were
received.
This commit was sponsored by Riku Voipio.
Diffstat (limited to 'Role/Watcher.hs')
-rw-r--r-- | Role/Watcher.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Role/Watcher.hs b/Role/Watcher.hs index c13234f..1ca0ae7 100644 --- a/Role/Watcher.hs +++ b/Role/Watcher.hs @@ -5,10 +5,11 @@ import Log import Pty import CmdLine import SessionID +import Role.Developer (run', processSessionStart, getServerMessage, emitOutput) import Control.Concurrent.STM import Control.Concurrent.STM.TMChan -import Role.Developer (run', processSessionStart, getServerMessage, emitOutput) +import Data.Time.Clock.POSIX run :: WatchOpts -> IO () run = run' watcher . watchUrl @@ -20,7 +21,8 @@ watcher _ichan ochan _ = inRawMode $ do go st where go st = do - v <- atomically $ getServerMessage ochan st + ts <- getPOSIXTime + v <- atomically $ getServerMessage ochan st ts case v of Nothing -> return () Just (o, _msg) -> do |