refactor: replace zap with slog (#6466)

Signed-off-by: knqyf263 <knqyf263@gmail.com>
Co-authored-by: Nikita Pivkin <nikita.pivkin@smartforce.io>
Co-authored-by: simar7 <1254783+simar7@users.noreply.github.com>
This commit is contained in:
Teppei Fukuda
2024-04-11 22:59:09 +04:00
committed by GitHub
parent 336c47ecc3
commit 94d6e8ced6
164 changed files with 1664 additions and 891 deletions

View File

@@ -22,14 +22,14 @@ func Install(ctx context.Context, dir, repo string, quiet bool, opt types.Regist
return xerrors.Errorf("repository parse error: %w", err)
}
log.Logger.Infof("Installing the module from %s...", repo)
log.Info("Installing the module from the repository...", log.String("repo", repo))
artifact, err := oci.NewArtifact(repo, quiet, opt)
if err != nil {
return xerrors.Errorf("module initialize error: %w", err)
}
dst := filepath.Join(dir, ref.Context().Name())
log.Logger.Debugf("Installing the module to %s...", dst)
log.Debug("Installing the module...", log.String("dst", dst))
if err = artifact.Download(ctx, dst, oci.DownloadOption{MediaType: mediaType}); err != nil {
return xerrors.Errorf("module download error: %w", err)
@@ -45,7 +45,7 @@ func Uninstall(_ context.Context, dir, repo string) error {
return xerrors.Errorf("repository parse error: %w", err)
}
log.Logger.Infof("Uninstalling %s ...", repo)
log.Info("Uninstalling the module ...", log.String("module", repo))
dst := filepath.Join(dir, ref.Context().Name())
if err = os.RemoveAll(dst); err != nil {
return xerrors.Errorf("remove error: %w", err)