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
|
if period >= maxPeriod: FAR_FUTURE_EPOCH
|
||||||
else: Epoch(period * EPOCHS_PER_SYNC_COMMITTEE_PERIOD)
|
else: Epoch(period * EPOCHS_PER_SYNC_COMMITTEE_PERIOD)
|
||||||
|
|
||||||
func shortLog*(t: BeaconTime): string =
|
func `$`*(t: BeaconTime): string =
|
||||||
if t.ns_since_genesis >= 0:
|
if t.ns_since_genesis >= 0:
|
||||||
$(timer.nanoseconds(t.ns_since_genesis))
|
$(timer.nanoseconds(t.ns_since_genesis))
|
||||||
else:
|
else:
|
||||||
"-" & $(timer.nanoseconds(-t.ns_since_genesis))
|
"-" & $(timer.nanoseconds(-t.ns_since_genesis))
|
||||||
|
|
||||||
func shortLog*(t: TimeDiff): string =
|
func `$`*(t: TimeDiff): string =
|
||||||
if t.nanoseconds >= 0:
|
if t.nanoseconds >= 0:
|
||||||
$(timer.nanoseconds(t.nanoseconds))
|
$(timer.nanoseconds(t.nanoseconds))
|
||||||
else:
|
else:
|
||||||
"-" & $(timer.nanoseconds(-t.nanoseconds))
|
"-" & $(timer.nanoseconds(-t.nanoseconds))
|
||||||
|
|
||||||
|
func shortLog*(t: BeaconTime | TimeDiff): string = $t
|
||||||
|
|
||||||
chronicles.formatIt BeaconTime: it.shortLog
|
chronicles.formatIt BeaconTime: it.shortLog
|
||||||
chronicles.formatIt TimeDiff: it.shortLog
|
chronicles.formatIt TimeDiff: it.shortLog
|
||||||
chronicles.formatIt Slot: it.shortLog
|
chronicles.formatIt Slot: it.shortLog
|
||||||
|
|
Loading…
Reference in New Issue