summaryrefslogtreecommitdiff
path: root/internal/command/shared/commandlogger/commandlogger.go
blob: 017eb11853a4989b0bd1385fce6b974ec31994a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package commandlogger

import (
	log "github.com/sirupsen/logrus"
	pb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
	"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/accessverifier"
)

func Log(command string, repository *pb.Repository, response *accessverifier.Response, protocol string) {
	fields := log.Fields{
		"command":       command,
		"glProjectPath": repository.GlProjectPath,
		"glRepository":  repository.GlRepository,
		"userId":        response.UserId,
		"userName":      response.Username,
		"gitProtocol":   protocol,
	}

	log.WithFields(fields).Info("executing git command")
}