Skip to content

Commit

Permalink
Merge pull request #421 from berty/dev/moul/chizap
Browse files Browse the repository at this point in the history
feat: switch to chizap to log user agent
  • Loading branch information
moul authored Jun 25, 2021
2 parents f4e5b2f + 96a6581 commit 7168e96
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
11 changes: 3 additions & 8 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 36 additions & 27 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/pkg/yolosvc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"github.com/rs/cors"
"github.com/stretchr/signature"
"github.com/tevino/abool"
chilogger "github.com/treastech/logger"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"moul.io/chizap"
"moul.io/u"
)

Expand Down Expand Up @@ -123,7 +123,7 @@ func NewServer(ctx context.Context, svc Service, opts ServerOpts) (*Server, erro
})
r.Use(cors.Handler)
}
r.Use(chilogger.Logger(srv.logger))
r.Use(chizap.New(srv.logger, &chizap.Opts{WithUserAgent: true, WithReferer: true}))
r.Use(middleware.Timeout(opts.RequestTimeout))
r.Use(middleware.Recoverer)

Expand Down

0 comments on commit 7168e96

Please sign in to comment.