Revert "logging: Always set fields func; fix #6829"

This reverts commit 932dac157a3c4693b80576477498bb86208b9b30.

Somehow the code I was looking at changed when I committed, without realizing it. This has already been fixed in #6777.
This commit is contained in:
Matthew Holt 2025-02-07 06:23:43 -07:00
parent 932dac157a
commit 9b74a53e51
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
2 changed files with 0 additions and 2 deletions

View File

@ -195,7 +195,6 @@ func (sa *StringArray) UnmarshalJSON(b []byte) error {
// have richer information.
func errLogValues(err error) (status int, msg string, fields func() []zapcore.Field) {
var handlerErr HandlerError
fields = func() []zapcore.Field { return []zapcore.Field{} } // don't be nil (fix #6829)
if errors.As(err, &handlerErr) {
status = handlerErr.StatusCode
if handlerErr.Err == nil {

View File

@ -408,7 +408,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if fields == nil {
fields = errFields()
}
c.Write(fields...)
}
}