diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2022-09-16 16:55:30 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2022-09-16 16:55:36 -0600 |
commit | e43b6d81782ef79f22058179d8793f40cea89556 (patch) | |
tree | 13648af23e92b26cb28c13cb12c620bf746c819c /modules/metrics | |
parent | bffc2587329ca7e1f8a28edae9b5a9bf11e2fc7c (diff) |
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.
Diffstat (limited to 'modules/metrics')
-rw-r--r-- | modules/metrics/metrics.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/metrics/metrics.go b/modules/metrics/metrics.go index 1ad392c..d4ad977 100644 --- a/modules/metrics/metrics.go +++ b/modules/metrics/metrics.go @@ -62,7 +62,7 @@ func (l *zapLogger) Println(v ...any) { // Provision sets up m. func (m *Metrics) Provision(ctx caddy.Context) error { - log := ctx.Logger(m) + log := ctx.Logger() m.metricsHandler = createMetricsHandler(&zapLogger{log}, !m.DisableOpenMetrics) return nil } @@ -75,10 +75,9 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) // UnmarshalCaddyfile sets up the handler from Caddyfile tokens. Syntax: // -// metrics [<matcher>] { -// disable_openmetrics -// } -// +// metrics [<matcher>] { +// disable_openmetrics +// } func (m *Metrics) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { for d.Next() { args := d.RemainingArgs() |