kubernetes/staging/src/k8s.io/apiserver/pkg/server/httplog/httplog.go

type StacktracePred

type ShouldLogRequestPred

type logger

type respLoggerContextKeyType

const respLoggerContextKey

type respLogger

var _

var _

func (rl *respLogger) Unwrap() http.ResponseWriter {}

type passthroughLogger

// Addf logs info immediately.
func (passthroughLogger) Addf(format string, data ...interface{}

// DefaultStacktracePred is the default implementation of StacktracePred.
func DefaultStacktracePred(status int) bool {}

const withLoggingLevel

// WithLogging wraps the handler with logging.
func WithLogging(handler http.Handler, pred StacktracePred) http.Handler {}

func withLogging(handler http.Handler, stackTracePred StacktracePred, shouldLogRequest ShouldLogRequestPred) http.Handler {}

// respLoggerFromContext returns the respLogger or nil.
func respLoggerFromContext(ctx context.Context) *respLogger {}

func respLoggerFromRequest(req *http.Request) *respLogger {}

func newLoggedWithStartTime(req *http.Request, w http.ResponseWriter, startTime time.Time) *respLogger {}

// newLogged turns a normal response writer into a logged response writer.
func newLogged(req *http.Request, w http.ResponseWriter) *respLogger {}

// LogOf returns the logger hiding in w. If there is not an existing logger
// then a passthroughLogger will be created which will log to stdout immediately
// when Addf is called.
func LogOf(req *http.Request, w http.ResponseWriter) logger {}

// Unlogged returns the original ResponseWriter, or w if it is not our inserted logger.
func Unlogged(req *http.Request, w http.ResponseWriter) http.ResponseWriter {}

// StacktraceWhen sets the stacktrace logging predicate, which decides when to log a stacktrace.
// There's a default, so you don't need to call this unless you don't like the default.
func (rl *respLogger) StacktraceWhen(pred StacktracePred) *respLogger {}

// StatusIsNot returns a StacktracePred which will cause stacktraces to be logged
// for any status *not* in the given list.
func StatusIsNot(statuses ...int) StacktracePred {}

// Addf adds additional data to be logged with this request.
func (rl *respLogger) Addf(format string, data ...interface{}

func AddInfof(ctx context.Context, format string, data ...interface{}

func (rl *respLogger) AddKeyValue(key string, value interface{}

// AddKeyValue adds a (key, value) pair to the httplog associated
// with the request.
// Use this function if you want your data to show up in httplog
// in a more structured and readable way.
func AddKeyValue(ctx context.Context, key string, value interface{}

// SetStacktracePredicate sets a custom stacktrace predicate for the
// logger associated with the given request context.
func SetStacktracePredicate(ctx context.Context, pred StacktracePred) {}

// Log is intended to be called once at the end of your request handler, via defer
func (rl *respLogger) Log() {}

// Header implements http.ResponseWriter.
func (rl *respLogger) Header() http.Header {}

// Write implements http.ResponseWriter.
func (rl *respLogger) Write(b []byte) (int, error) {}

// WriteHeader implements http.ResponseWriter.
func (rl *respLogger) WriteHeader(status int) {}

func (rl *respLogger) Hijack() (net.Conn, *bufio.ReadWriter, error) {}

func (rl *respLogger) recordStatus(status int) {}