Skip to content
Myr

Add response size to LogFormatterParams (#1752)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Pierre Massat · committed by 田欧 · parent d7daffc · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:logger.go+4 added
62 unmodified lines
63 // ErrorMessage is set if error has occurred in processing the request.64 ErrorMessage string65 // IsTerm shows whether does gin's output descriptor refers to a terminal.66 IsTerm bool67 // BodySize is the size of the Response Body68 BodySize int69}7071// defaultLogFormatter is the default log format function Logger middleware uses.72var defaultLogFormatter = func(param LogFormatterParams) string {
119 unmodified lines
192 param.Method = c.Request.Method193 param.StatusCode = c.Writer.Status()194 param.ErrorMessage = c.Errors.ByType(ErrorTypePrivate).String()195196 param.BodySize = c.Writer.Size()197198 if raw != "" {199 path = path + "?" + raw200 }201
40 unmodified lines