From 746d2cc7309e710f1378e7d62d36cbdcabe79178 Mon Sep 17 00:00:00 2001 From: Ronan Barrett Date: Tue, 7 Dec 2021 14:32:07 +0100 Subject: [PATCH] improve documentation for WithLogLevelHandlers --- README.md | 2 ++ options.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f1cb7d4..243945b 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ See [Prometheus' http handler](https://godoc.org/github.com/prometheus/client_go `PUT /loglevel` sets a new log level. This can be useful to temporarily change the service's log level to `debug` to allow for better troubleshooting. +This option must be passed after other options that manipulate the logger to have any effect on that logger option. + See [Zap's http_handler.go](https://github.com/uber-go/zap/blob/master/http_handler.go). diff --git a/options.go b/options.go index a9adfe3..51855d0 100644 --- a/options.go +++ b/options.go @@ -43,7 +43,8 @@ func WithRouter(router *http.ServeMux) Option { } // WithLogLevelHandlers is an option that sets up HTTP routes to read write the -// log level. +// log level. This option must be passed after other options that manipulate the +// logger to have any effect on that logger option. func WithLogLevelHandlers() Option { return func(s *SVC) error { s.Router.Handle("/loglevel", s.atom)