From 2a006c4ee8b47887ddc1274dab9f645caf679c41 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 14 Sep 2023 16:59:12 +0200 Subject: log: Wrap the logrus logger Introduce a wrapper for the logrus logging infrastructure. This is a first step towards abstracting away the actual implementation of our logs behind a type that we can iterate on and will thus pave the way towards adoption of the `slog` package. Note that this is only one step of this transition. The interface does not yet roundtrip to itself, e.g. calling `log.Logger.WithError()` will result in a `logrus.Entry`, not in a `log.Logger`. This will be handled at a later point. --- cmd/gitaly-ssh/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/gitaly-ssh') diff --git a/cmd/gitaly-ssh/main.go b/cmd/gitaly-ssh/main.go index 5b1bf262f..b34e99f32 100644 --- a/cmd/gitaly-ssh/main.go +++ b/cmd/gitaly-ssh/main.go @@ -7,7 +7,6 @@ import ( "strconv" "strings" - "github.com/sirupsen/logrus" gitalyauth "gitlab.com/gitlab-org/gitaly/v16/auth" "gitlab.com/gitlab-org/gitaly/v16/internal/featureflag" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/client" @@ -87,7 +86,7 @@ func main() { os.Exit(code) } -func (cmd gitalySSHCommand) run(logger logrus.FieldLogger) (int, error) { +func (cmd gitalySSHCommand) run(logger log.Logger) (int, error) { // Configure distributed tracing closer := tracing.Initialize(tracing.WithServiceName("gitaly-ssh")) defer closer.Close() @@ -132,7 +131,7 @@ func (cmd gitalySSHCommand) run(logger logrus.FieldLogger) (int, error) { return int(code), nil } -func getConnection(ctx context.Context, url string, registry *sidechannel.Registry, logger logrus.FieldLogger) (*grpc.ClientConn, error) { +func getConnection(ctx context.Context, url string, registry *sidechannel.Registry, logger log.Logger) (*grpc.ClientConn, error) { if url == "" { return nil, fmt.Errorf("gitaly address can not be empty") } -- cgit v1.2.3