Skip to content

Commit cb7bc03

Browse files
authored
Merge pull request #647 from karknu/karknu/1ms_resolution_master
Increase log time resolution from 10ms to 1ms
2 parents 998ce32 + 8823a1a commit cb7bc03

File tree

1 file changed

+5
-5
lines changed
  • iohk-monitoring/src/Cardano/BM/Backend

1 file changed

+5
-5
lines changed

iohk-monitoring/src/Cardano/BM/Backend/Log.lhs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,20 +420,20 @@ renderJsonMsg r =
420420
m' = encodeToLazyText $ trimTime $ K.itemJson (verbosity r) li'
421421
in (fromIntegral $ TL.length m', m')
422422
423-
-- keep only two digits for the fraction of seconds
423+
-- keep only three digits for the fraction of seconds
424424
trimTime :: Value -> Value
425425
trimTime (Object o) = Object . runIdentity $ KeyMap.alterF
426-
(\a -> Identity $ keep2Decimals <$> a)
426+
(\a -> Identity $ keep3Decimals <$> a)
427427
"at"
428428
o
429429
where
430-
keep2Decimals :: Value -> Value
431-
keep2Decimals v = case fromJSON v of
430+
keep3Decimals :: Value -> Value
431+
keep3Decimals v = case fromJSON v of
432432
Success (utct :: UTCTime) ->
433433
String $ pack $ formatTime defaultTimeLocale jformat utct
434434
_ -> v
435435
jformat :: String
436-
jformat = "%FT%T%2QZ"
436+
jformat = "%FT%T%3QZ"
437437
trimTime v = v
438438
439439
mkFileScribe

0 commit comments

Comments
 (0)