log: write durations as text, not nanoseconds (closes #228)
check / check (push) Successful in 1m21s
check / check (push) Successful in 1m21s
The JSON log wrote a Go duration as a bare count of nanoseconds, so the watcher starting line showed dnsInterval 120000000000 for 2m and a delivery retry showed retryIn 1015437050. Each duration logged is now passed through its String() form: dnsInterval and tlsInterval when the watcher starts, retryIn on a delivery retry, and latency on a succeeded port check. A test checks that retryIn is logged as the text of the wait the retry actually took. The request log's latency_ms is left as it is: its key names its unit. Model: opus-5-5
This commit is contained in:
@@ -123,8 +123,10 @@ func (w *Watcher) Run(ctx context.Context) {
|
||||
"watcher starting",
|
||||
"domains", len(w.config.Domains),
|
||||
"hostnames", len(w.config.Hostnames),
|
||||
"dnsInterval", w.config.DNSInterval,
|
||||
"tlsInterval", w.config.TLSInterval,
|
||||
// As text: the JSON log writes a time.Duration as bare
|
||||
// nanoseconds.
|
||||
"dnsInterval", w.config.DNSInterval.String(),
|
||||
"tlsInterval", w.config.TLSInterval.String(),
|
||||
)
|
||||
|
||||
w.RunOnce(ctx)
|
||||
|
||||
Reference in New Issue
Block a user