LogHandler returns an http.Handler that logs to opts.Logf. It logs both successful and failing requests. The log line includes the first error returned to [ErrorHandler] within. The outer-most LogHandler(LogHandler(...)) does all of the logging. Inner LogHandler instance do nothing. Panics are swall
(h http.Handler, opts LogOptions)
| 472 | // Inner LogHandler instance do nothing. |
| 473 | // Panics are swallowed and their stack traces are put in the error. |
| 474 | func LogHandler(h http.Handler, opts LogOptions) http.Handler { |
| 475 | return logHandler{h, opts.withDefaults()} |
| 476 | } |
| 477 | |
| 478 | // ErrorHandler converts a [ReturnHandler] into a standard [http.Handler]. |
| 479 | // Errors are handled as specified by the [ReturnHandler.ServeHTTPReturn] method. |
searching dependent graphs…