From e43b6d81782ef79f22058179d8793f40cea89556 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 16 Sep 2022 16:55:30 -0600 Subject: core: Variadic Context.Logger(); soft deprecation Ideally I'd just remove the parameter to caddy.Context.Logger(), but this would break most Caddy plugins. Instead, I'm making it variadic and marking it as partially deprecated. In the future, I might completely remove the parameter once most plugins have updated. --- modules/caddytls/acmeissuer.go | 2 +- modules/caddytls/certmanagers.go | 2 +- modules/caddytls/internalissuer.go | 13 ++++++------- modules/caddytls/matchers.go | 2 +- modules/caddytls/tls.go | 2 +- modules/caddytls/zerosslissuer.go | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) (limited to 'modules/caddytls') diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go index 2fe4004..2f752ed 100644 --- a/modules/caddytls/acmeissuer.go +++ b/modules/caddytls/acmeissuer.go @@ -103,7 +103,7 @@ func (ACMEIssuer) CaddyModule() caddy.ModuleInfo { // Provision sets up iss. func (iss *ACMEIssuer) Provision(ctx caddy.Context) error { - iss.logger = ctx.Logger(iss) + iss.logger = ctx.Logger() repl := caddy.NewReplacer() diff --git a/modules/caddytls/certmanagers.go b/modules/caddytls/certmanagers.go index de7abf9..1b701ab 100644 --- a/modules/caddytls/certmanagers.go +++ b/modules/caddytls/certmanagers.go @@ -43,7 +43,7 @@ func (Tailscale) CaddyModule() caddy.ModuleInfo { } func (ts *Tailscale) Provision(ctx caddy.Context) error { - ts.logger = ctx.Logger(ts) + ts.logger = ctx.Logger() return nil } diff --git a/modules/caddytls/internalissuer.go b/modules/caddytls/internalissuer.go index ba6055e..3dd6c35 100644 --- a/modules/caddytls/internalissuer.go +++ b/modules/caddytls/internalissuer.go @@ -65,7 +65,7 @@ func (InternalIssuer) CaddyModule() caddy.ModuleInfo { // Provision sets up the issuer. func (iss *InternalIssuer) Provision(ctx caddy.Context) error { - iss.logger = ctx.Logger(iss) + iss.logger = ctx.Logger() // set some defaults if iss.CA == "" { @@ -148,12 +148,11 @@ func (iss InternalIssuer) Issue(ctx context.Context, csr *x509.CertificateReques // UnmarshalCaddyfile deserializes Caddyfile tokens into iss. // -// ... internal { -// ca -// lifetime -// sign_with_root -// } -// +// ... internal { +// ca +// lifetime +// sign_with_root +// } func (iss *InternalIssuer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { for d.Next() { for d.NextBlock(0) { diff --git a/modules/caddytls/matchers.go b/modules/caddytls/matchers.go index 4a22bc0..f541220 100644 --- a/modules/caddytls/matchers.go +++ b/modules/caddytls/matchers.go @@ -81,7 +81,7 @@ func (MatchRemoteIP) CaddyModule() caddy.ModuleInfo { // Provision parses m's IP ranges, either from IP or CIDR expressions. func (m *MatchRemoteIP) Provision(ctx caddy.Context) error { - m.logger = ctx.Logger(m) + m.logger = ctx.Logger() for _, str := range m.Ranges { cidrs, err := m.parseIPRange(str) if err != nil { diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go index 2e532ed..8051653 100644 --- a/modules/caddytls/tls.go +++ b/modules/caddytls/tls.go @@ -94,7 +94,7 @@ func (t *TLS) Provision(ctx caddy.Context) error { } t.events = eventsAppIface.(*caddyevents.App) t.ctx = ctx - t.logger = ctx.Logger(t) + t.logger = ctx.Logger() repl := caddy.NewReplacer() // set up a new certificate cache; this (re)loads all certificates diff --git a/modules/caddytls/zerosslissuer.go b/modules/caddytls/zerosslissuer.go index c7ff70f..0209294 100644 --- a/modules/caddytls/zerosslissuer.go +++ b/modules/caddytls/zerosslissuer.go @@ -66,7 +66,7 @@ func (*ZeroSSLIssuer) CaddyModule() caddy.ModuleInfo { // Provision sets up iss. func (iss *ZeroSSLIssuer) Provision(ctx caddy.Context) error { - iss.logger = ctx.Logger(iss) + iss.logger = ctx.Logger() if iss.ACMEIssuer == nil { iss.ACMEIssuer = new(ACMEIssuer) } -- cgit v1.2.3