diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-08-11 12:48:17 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-08-15 08:17:59 +0300 |
commit | ee82c922f159fda1d784fce4206a4c294a8aa0b3 (patch) | |
tree | ea11661aba214d09c450d511057977b1ac54c6fd | |
parent | caaefc1b7b64ef89eeea6794843c6f8d5ae25b9f (diff) |
gitaly/server: Convert to use `logrus.FieldLogger` interface
Same as the preceding commit, this commit refactors the Gitaly server
factory to accept a `logrus.FieldLogger` interface instead of an actual
implementation.
-rw-r--r-- | internal/gitaly/server/server.go | 4 | ||||
-rw-r--r-- | internal/gitaly/server/server_factory.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/gitaly/server/server.go b/internal/gitaly/server/server.go index 0ea9186d4..2b1127d97 100644 --- a/internal/gitaly/server/server.go +++ b/internal/gitaly/server/server.go @@ -111,7 +111,7 @@ func (s *GitalyServerFactory) New(secure bool, opts ...Option) (*grpc.Server, er metadatahandler.StreamInterceptor, grpcprometheus.StreamServerInterceptor, customfieldshandler.StreamInterceptor, - grpcmwlogrus.StreamServerInterceptor(s.logger, + grpcmwlogrus.StreamServerInterceptor(s.logger.WithField("component", "gitaly.StreamServerInterceptor"), grpcmwlogrus.WithTimestampFormat(gitalylog.LogTimestampFormat), logMsgProducer, gitalylog.DeciderOption(), @@ -127,7 +127,7 @@ func (s *GitalyServerFactory) New(secure bool, opts ...Option) (*grpc.Server, er metadatahandler.UnaryInterceptor, grpcprometheus.UnaryServerInterceptor, customfieldshandler.UnaryInterceptor, - grpcmwlogrus.UnaryServerInterceptor(s.logger, + grpcmwlogrus.UnaryServerInterceptor(s.logger.WithField("component", "gitaly.UnaryServerInterceptor"), grpcmwlogrus.WithTimestampFormat(gitalylog.LogTimestampFormat), logMsgProducer, gitalylog.DeciderOption(), diff --git a/internal/gitaly/server/server_factory.go b/internal/gitaly/server/server_factory.go index 10afb3ce3..8639a8e0e 100644 --- a/internal/gitaly/server/server_factory.go +++ b/internal/gitaly/server/server_factory.go @@ -17,7 +17,7 @@ type GitalyServerFactory struct { cacheInvalidator cache.Invalidator limitHandlers []*limithandler.LimiterMiddleware cfg config.Cfg - logger *logrus.Entry + logger logrus.FieldLogger externalServers []*grpc.Server internalServers []*grpc.Server } @@ -25,7 +25,7 @@ type GitalyServerFactory struct { // NewGitalyServerFactory allows to create and start secure/insecure 'grpc.Server's. func NewGitalyServerFactory( cfg config.Cfg, - logger *logrus.Entry, + logger logrus.FieldLogger, registry *backchannel.Registry, cacheInvalidator cache.Invalidator, limitHandlers []*limithandler.LimiterMiddleware, |