mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
refactor: improve a log inside renew
This commit is contained in:
parent
62dcd9d6f7
commit
e4659fa15d
1 changed files with 6 additions and 6 deletions
|
|
@ -142,11 +142,9 @@ func renewForDomains(ctx context.Context, cmd *cli.Command, lazyClient lzSetUp,
|
|||
}
|
||||
|
||||
// This is just meant to be informal for the user.
|
||||
timeLeft := cert.NotAfter.Sub(time.Now().UTC())
|
||||
|
||||
log.Info("acme: Trying renewal.",
|
||||
log.DomainAttr(domain),
|
||||
slog.Int("hoursRemaining", int(timeLeft.Hours())),
|
||||
slog.Any("time-remaining", FormattableDuration(cert.NotAfter.Sub(time.Now().UTC()))),
|
||||
)
|
||||
|
||||
client, err := lazyClient()
|
||||
|
|
@ -233,11 +231,9 @@ func renewForCSR(ctx context.Context, cmd *cli.Command, lazyClient lzSetUp, cert
|
|||
}
|
||||
|
||||
// This is just meant to be informal for the user.
|
||||
timeLeft := cert.NotAfter.Sub(time.Now().UTC())
|
||||
|
||||
log.Info("acme: Trying renewal.",
|
||||
log.DomainAttr(domain),
|
||||
slog.Int("hoursRemaining", int(timeLeft.Hours())),
|
||||
slog.Any("time-remaining", FormattableDuration(cert.NotAfter.Sub(time.Now().UTC()))),
|
||||
)
|
||||
|
||||
client, err := lazyClient()
|
||||
|
|
@ -475,3 +471,7 @@ func (f FormattableDuration) String() string {
|
|||
|
||||
return s.String()
|
||||
}
|
||||
|
||||
func (f FormattableDuration) LogValue() slog.Value {
|
||||
return slog.StringValue(f.String())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue