Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix request latency output with default template. #57

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions accesslog/accesslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ func new(ctx context.Context, opts ...Option) app.HandlerFunc {
}

return func(ctx context.Context, c *app.RequestContext) {
var start, stop time.Time

// Logger data
data := dataPool.Get().(*Data) //nolint:forcetypeassert,errcheck // We store nothing else in the pool
// no need for a reset, as long as we always override everything
Expand Down Expand Up @@ -139,7 +137,7 @@ func new(ctx context.Context, opts ...Option) app.HandlerFunc {
_, _ = buf.WriteString(fmt.Sprintf(defaultFormat,
timestamp,
c.Response.StatusCode(),
stop.Sub(start),
data.Stop.Sub(data.Start),
c.Method(),
c.Path(),
))
Expand Down
Loading