on master help sign in
Change default timer resolution from 1s to 1ms

This resolves #92

commit778293fbaeb72a4406aa025e5a85f8be6faca6e2 authorMichael Xavier <michael@michaelxavier.net> dateTue 29 May 2018, 09:21 (8 years ago) parent9ccbe91
1 file changed+5−5
katip/src/Katip/Core.hs+5−5
katip/src/Katip/Core.hs+5−5
@@ -601,10 +601,10 @@ makeLenses ''LogEnv
601601
602602
603603-------------------------------------------------------------------------------
604−-- | Create a reasonable default InitLogEnv. Uses an 'AutoUdate' with
605−-- the default settings as the timer. If you are concerned about
606−-- timestamp precision or event ordering in log outputs like
607−-- ElasticSearch, you should replace the timer with 'getCurrentTime'
604+-- | Create a reasonable default InitLogEnv. Uses an 'AutoUdate' which
605+-- updates the timer every 1ms. If you need even more timestamp
606+-- precision at the cost of performance, consider setting
607+-- '_logEnvTimer' with 'getCurrentTime'.
608608initLogEnv
609609 :: Namespace
610610 -- ^ A base namespace for this application
@@ -616,7 +616,7 @@ initLogEnv an env = LogEnv
616616 <*> getProcessID
617617 <*> pure an
618618 <*> pure env
619− <*> mkAutoUpdate defaultUpdateSettings { updateAction = getCurrentTime }
619+ <*> mkAutoUpdate defaultUpdateSettings { updateAction = getCurrentTime, updateFreq = 1000 }
620620 <*> pure mempty
621621
622622