mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 07:29:03 -04:00
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:
parent
932dac157a
commit
9b74a53e51
@ -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 {
|
||||
|
@ -408,7 +408,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
if fields == nil {
|
||||
fields = errFields()
|
||||
}
|
||||
|
||||
c.Write(fields...)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user