diff options
author | David Kim <dkim@gitlab.com> | 2020-04-03 12:46:40 +1030 |
---|---|---|
committer | David Kim <dkim@gitlab.com> | 2020-04-03 12:46:40 +1030 |
commit | 1af1245ec4a9fc330a7d4979a55a5fee1aca82cb (patch) | |
tree | 4c7d0ebe013c516f197bf117b4bcce8f53915eef /internal/command/receivepack/gitalycall.go | |
parent | 3f3a405c181840e2de13ffb22f7a50fd78054dc0 (diff) | |
download | gitlab-shell-1af1245ec4a9fc330a7d4979a55a5fee1aca82cb.tar.gz |
Add test for command logging
Diffstat (limited to 'internal/command/receivepack/gitalycall.go')
-rw-r--r-- | internal/command/receivepack/gitalycall.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/internal/command/receivepack/gitalycall.go b/internal/command/receivepack/gitalycall.go index 8a9b4ba..9de3b8e 100644 --- a/internal/command/receivepack/gitalycall.go +++ b/internal/command/receivepack/gitalycall.go @@ -6,11 +6,11 @@ import ( "google.golang.org/grpc" - log "github.com/sirupsen/logrus" "gitlab.com/gitlab-org/gitaly/client" pb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" "gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs" "gitlab.com/gitlab-org/gitlab-shell/internal/command/shared/accessverifier" + "gitlab.com/gitlab-org/gitlab-shell/internal/command/shared/commandlogger" "gitlab.com/gitlab-org/gitlab-shell/internal/handler" ) @@ -32,16 +32,7 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error { GitConfigOptions: response.GitConfigOptions, } - fields := log.Fields{ - "command": "git-receive-pack", - "glProjectPath": request.Repository.GlProjectPath, - "glRepository": request.Repository.GlRepository, - "userId": response.UserId, - "userName": response.Username, - "gitProtocol": request.GitProtocol, - } - - log.WithFields(fields).Info("executing git command") + commandlogger.Log("git-receive-pack", request.Repository, response, "") return gc.RunGitalyCommand(func(ctx context.Context, conn *grpc.ClientConn) (int32, error) { ctx, cancel := context.WithCancel(ctx) |