diff options
author | John Cai <jcai@gitlab.com> | 2022-04-15 16:43:53 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2022-04-15 16:43:53 +0300 |
commit | db61c6f24ea0a8124575561faf44afea53a9afed (patch) | |
tree | 61ed18c6e2f0eafe64e5190d066a64a4f7b6e5c0 | |
parent | 57311fd8ccfcc1ad12bade792bcfc53a9f708cac (diff) |
fixing loggingjc-cgroups-version-2
-rw-r--r-- | internal/cgroups/v1_linux.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/cgroups/v1_linux.go b/internal/cgroups/v1_linux.go index 48d3aeb70..0b6cb74dc 100644 --- a/internal/cgroups/v1_linux.go +++ b/internal/cgroups/v1_linux.go @@ -117,8 +117,11 @@ func (cg *CGroupV1Manager) AddCommand( gitCmdName string, repo repository.GitRepo, ) error { + logger := log.Default().WithField("git_command", gitCmdName) + gitCmdDetails, ok := cg.gitCmds[gitCmdName] if !ok { + logger.Info("adding to repository cgroup") return cg.addRepositoryCmd(cmd, repo) } @@ -152,11 +155,11 @@ func (cg *CGroupV1Manager) AddCommand( } return fmt.Errorf("failed adding process to cgroup: %w", err) } + logger.Info("adding to git cgroup") default: cg.gitWithoutCgroup.Inc() - log.Default().WithField("git_cmd", gitCmdName). - WithField("relative_path", repo.GetRelativePath()). - Warn("git command could not be added to a cgroup") + logger.WithField("relative_path", repo.GetRelativePath()). + Info("could not be added to cgroup") return nil } |