Skip to content

Commit

Permalink
improve documentation for WithLogLevelHandlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan Barrett committed Dec 7, 2021
1 parent debead3 commit 746d2cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).


Expand Down
3 changes: 2 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 746d2cc

Please sign in to comment.