refactor: use central logger
This commit is contained in:
@ -9,11 +9,11 @@ import (
|
||||
"strings"
|
||||
|
||||
"coopcloud.tech/abra/pkg/config"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
"github.com/go-git/go-git/v5"
|
||||
gitConfigPkg "github.com/go-git/go-git/v5/config"
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
"github.com/go-git/go-git/v5/plumbing/format/gitignore"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// GetRecipeHead retrieves latest HEAD metadata.
|
||||
@ -60,9 +60,9 @@ func IsClean(repoPath string) (bool, error) {
|
||||
}
|
||||
|
||||
if status.String() != "" {
|
||||
logrus.Debugf("discovered git status in %s: %s", repoPath, status.String())
|
||||
log.Debugf("discovered git status in %s: %s", repoPath, status.String())
|
||||
} else {
|
||||
logrus.Debugf("discovered clean git status in %s", repoPath)
|
||||
log.Debugf("discovered clean git status in %s", repoPath)
|
||||
}
|
||||
|
||||
return status.IsClean(), nil
|
||||
@ -98,7 +98,7 @@ func parseGitConfig() (*gitConfigPkg.Config, error) {
|
||||
globalGitConfig := filepath.Join(usr.HomeDir, ".gitconfig")
|
||||
if _, err := os.Stat(globalGitConfig); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
logrus.Debugf("no %s exists, not reading any global gitignore config", globalGitConfig)
|
||||
log.Debugf("no %s exists, not reading any global gitignore config", globalGitConfig)
|
||||
return cfg, nil
|
||||
}
|
||||
return cfg, err
|
||||
@ -140,7 +140,7 @@ func parseExcludesFile(excludesfile string) ([]gitignore.Pattern, error) {
|
||||
|
||||
if _, err := os.Stat(excludesfile); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
logrus.Debugf("no %s exists, skipping reading gitignore paths", excludesfile)
|
||||
log.Debugf("no %s exists, skipping reading gitignore paths", excludesfile)
|
||||
return ps, nil
|
||||
}
|
||||
return ps, err
|
||||
@ -159,7 +159,7 @@ func parseExcludesFile(excludesfile string) ([]gitignore.Pattern, error) {
|
||||
}
|
||||
}
|
||||
|
||||
logrus.Debugf("read global ignore paths: %s", strings.Join(pathsRaw, " "))
|
||||
log.Debugf("read global ignore paths: %s", strings.Join(pathsRaw, " "))
|
||||
|
||||
return ps, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user