MCPcopy Create free account
hub / github.com/couchbase/cbft / logf

Function logf

cmd/cbft/timeout_handler.go:199–206  ·  view source on GitHub ↗

logf prints to the ErrorLog of the *Server associated with request r via ServerContextKey. If there's no associated server, or if ErrorLog is nil, logging is done via the log package's standard logger.

(r *http.Request, format string, args ...interface{})

Source from the content-addressed store, hash-verified

197// via ServerContextKey. If there's no associated server, or if ErrorLog
198// is nil, logging is done via the log package's standard logger.
199func logf(r *http.Request, format string, args ...interface{}) {
200 s, _ := r.Context().Value(http.ServerContextKey).(*http.Server)
201 if s != nil && s.ErrorLog != nil {
202 s.ErrorLog.Printf(format, args...)
203 } else {
204 log.Printf(format, args...)
205 }
206}
207
208func checkWriteHeaderCode(code int) {
209 // Issue 22880: require valid WriteHeader status codes.

Callers 1

writeHeaderLockedMethod · 0.85

Calls 1

ContextMethod · 0.80

Tested by

no test coverage detected