on master help sign in
Change default timer resolution from 1s to 1ms
778293fMichael Xavier
katip/src/Katip/Core.hs+5−5
@@ -601,10 +601,10 @@ makeLenses ''LogEnv
601
601
602
602
603-------------------------------------------------------------------------------
603-------------------------------------------------------------------------------
604−-- | Create a reasonable default InitLogEnv. Uses an 'AutoUdate' with
604+-- | Create a reasonable default InitLogEnv. Uses an 'AutoUdate' which
605−-- the default settings as the timer. If you are concerned about
605+-- updates the timer every 1ms. If you need even more timestamp
606−-- timestamp precision or event ordering in log outputs like
606+-- precision at the cost of performance, consider setting
607−-- ElasticSearch, you should replace the timer with 'getCurrentTime'
607+-- '_logEnvTimer' with 'getCurrentTime'.
608initLogEnv
608initLogEnv
609 :: Namespace
609 :: Namespace
610 -- ^ A base namespace for this application
610 -- ^ A base namespace for this application
@@ -616,7 +616,7 @@ initLogEnv an env = LogEnv
616 <*> getProcessID
616 <*> getProcessID
617 <*> pure an
617 <*> pure an
618 <*> pure env
618 <*> pure env
619− <*> mkAutoUpdate defaultUpdateSettings { updateAction = getCurrentTime }
619+ <*> mkAutoUpdate defaultUpdateSettings { updateAction = getCurrentTime, updateFreq = 1000 }
620 <*> pure mempty
620 <*> pure mempty
621
621
622
622