mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-23 13:00:34 +00:00
fix ugly delay logging
This commit is contained in:
parent
ff5b91cd58
commit
6bf3330d73
@ -236,18 +236,20 @@ template start_epoch*(period: SyncCommitteePeriod): Epoch =
|
||||
if period >= maxPeriod: FAR_FUTURE_EPOCH
|
||||
else: Epoch(period * EPOCHS_PER_SYNC_COMMITTEE_PERIOD)
|
||||
|
||||
func shortLog*(t: BeaconTime): string =
|
||||
func `$`*(t: BeaconTime): string =
|
||||
if t.ns_since_genesis >= 0:
|
||||
$(timer.nanoseconds(t.ns_since_genesis))
|
||||
else:
|
||||
"-" & $(timer.nanoseconds(-t.ns_since_genesis))
|
||||
|
||||
func shortLog*(t: TimeDiff): string =
|
||||
func `$`*(t: TimeDiff): string =
|
||||
if t.nanoseconds >= 0:
|
||||
$(timer.nanoseconds(t.nanoseconds))
|
||||
else:
|
||||
"-" & $(timer.nanoseconds(-t.nanoseconds))
|
||||
|
||||
func shortLog*(t: BeaconTime | TimeDiff): string = $t
|
||||
|
||||
chronicles.formatIt BeaconTime: it.shortLog
|
||||
chronicles.formatIt TimeDiff: it.shortLog
|
||||
chronicles.formatIt Slot: it.shortLog
|
||||
|
Loading…
x
Reference in New Issue
Block a user