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/caddypki/acmeserver/acmeserver.go | 2 +- modules/caddypki/adminapi.go | 2 +- modules/caddypki/pki.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/caddypki') diff --git a/modules/caddypki/acmeserver/acmeserver.go b/modules/caddypki/acmeserver/acmeserver.go index ff021b4..921d0b8 100644 --- a/modules/caddypki/acmeserver/acmeserver.go +++ b/modules/caddypki/acmeserver/acmeserver.go @@ -87,7 +87,7 @@ func (Handler) CaddyModule() caddy.ModuleInfo { // Provision sets up the ACME server handler. func (ash *Handler) Provision(ctx caddy.Context) error { - ash.logger = ctx.Logger(ash) + ash.logger = ctx.Logger() // set some defaults if ash.CA == "" { ash.CA = caddypki.DefaultCAID diff --git a/modules/caddypki/adminapi.go b/modules/caddypki/adminapi.go index b4d2695..f03c6b6 100644 --- a/modules/caddypki/adminapi.go +++ b/modules/caddypki/adminapi.go @@ -47,7 +47,7 @@ func (adminAPI) CaddyModule() caddy.ModuleInfo { // Provision sets up the adminAPI module. func (a *adminAPI) Provision(ctx caddy.Context) error { a.ctx = ctx - a.log = ctx.Logger(a) + a.log = ctx.Logger(a) // TODO: passing in 'a' is a hack until the admin API is officially extensible (see #5032) // First check if the PKI app was configured, because // a.ctx.App() has the side effect of instantiating diff --git a/modules/caddypki/pki.go b/modules/caddypki/pki.go index 4fd0bb5..2caeb2b 100644 --- a/modules/caddypki/pki.go +++ b/modules/caddypki/pki.go @@ -54,7 +54,7 @@ func (PKI) CaddyModule() caddy.ModuleInfo { // Provision sets up the configuration for the PKI app. func (p *PKI) Provision(ctx caddy.Context) error { p.ctx = ctx - p.log = ctx.Logger(p) + p.log = ctx.Logger() for caID, ca := range p.CAs { err := ca.Provision(ctx, caID, p.log) -- cgit v1.2.3