--debug log messages are now timestamped with fractional seconds.
This commit is contained in:
parent
626d273240
commit
7584e47ba3
4 changed files with 14 additions and 9 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue