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{})
| 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. |
| 199 | func 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 | |
| 208 | func checkWriteHeaderCode(code int) { |
| 209 | // Issue 22880: require valid WriteHeader status codes. |
no test coverage detected