aboutsummaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-08-12 14:42:49 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-08-12 14:42:49 -0400
commit95e9be1bd491a5f598f7c2aaf202f7888ff3223c (patch)
treeac43084a72927d7577f8955e44a68c2044edc0c0 /Messages.hs
parentff5d0a341bcca6524c3241da7532a47e08c566e0 (diff)
--debug log messages are now timestamped with fractional seconds.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Messages.hs b/Messages.hs
index f6d26db9d..c6d033402 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -173,7 +173,7 @@ setupConsole :: IO ()
setupConsole = do
s <- setFormatter
<$> streamHandler stderr DEBUG
- <*> pure (simpleLogFormatter "[$time] $msg")
+ <*> pure preciseLogFormatter
updateGlobalLogger rootLoggerName (setLevel NOTICE . setHandlers [s])
{- This avoids ghc's output layer crashing on
- invalid encoded characters in
@@ -181,6 +181,10 @@ setupConsole = do
fileEncoding stdout
fileEncoding stderr
+{- Log formatter with precision into fractions of a second. -}
+preciseLogFormatter :: LogFormatter a
+preciseLogFormatter = tfLogFormatter "%F %X%Q" "[$time] $msg"
+
enableDebugOutput :: IO ()
enableDebugOutput = updateGlobalLogger rootLoggerName $ setLevel DEBUG