MCPcopy Index your code
hub / github.com/tailscale/tailscale / LogHandler

Function LogHandler

tsweb/tsweb.go:474–476  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

472// Inner LogHandler instance do nothing.
473// Panics are swallowed and their stack traces are put in the error.
474func 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.

Callers 2

StdHandlerFunction · 0.85

Calls 1

withDefaultsMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…