remove extraneous debug logs from cli (#675)
This commit is contained in:
parent
56c7e0f85f
commit
3f6f6604a2
@ -11,7 +11,6 @@ import (
|
||||
"github.com/alcionai/corso/cli/utils"
|
||||
"github.com/alcionai/corso/internal/model"
|
||||
"github.com/alcionai/corso/pkg/backup"
|
||||
"github.com/alcionai/corso/pkg/logger"
|
||||
"github.com/alcionai/corso/pkg/repository"
|
||||
"github.com/alcionai/corso/pkg/selectors"
|
||||
)
|
||||
@ -175,17 +174,6 @@ func createExchangeCmd(cmd *cobra.Command, args []string) error {
|
||||
return Only(ctx, err)
|
||||
}
|
||||
|
||||
m365, err := acct.M365Config()
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to parse m365 account config"))
|
||||
}
|
||||
|
||||
logger.Ctx(ctx).Debugw(
|
||||
"Called - "+cmd.CommandPath(),
|
||||
"tenantID", m365.TenantID,
|
||||
"clientID", m365.ClientID,
|
||||
"hasClientSecret", len(m365.ClientSecret) > 0)
|
||||
|
||||
r, err := repository.Connect(ctx, acct, s)
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrapf(err, "Failed to connect to the %s repository", s.Provider))
|
||||
@ -284,15 +272,6 @@ func listExchangeCmd(cmd *cobra.Command, args []string) error {
|
||||
return Only(ctx, err)
|
||||
}
|
||||
|
||||
m365, err := acct.M365Config()
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to parse m365 account config"))
|
||||
}
|
||||
|
||||
logger.Ctx(ctx).Debugw(
|
||||
"Called - "+cmd.CommandPath(),
|
||||
"tenantID", m365.TenantID)
|
||||
|
||||
r, err := repository.Connect(ctx, acct, s)
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrapf(err, "Failed to connect to the %s repository", s.Provider))
|
||||
@ -349,15 +328,6 @@ func detailsExchangeCmd(cmd *cobra.Command, args []string) error {
|
||||
return Only(ctx, err)
|
||||
}
|
||||
|
||||
m365, err := acct.M365Config()
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to parse m365 account config"))
|
||||
}
|
||||
|
||||
logger.Ctx(ctx).Debugw(
|
||||
"Called - "+cmd.CommandPath(),
|
||||
"tenantID", m365.TenantID)
|
||||
|
||||
r, err := repository.Connect(ctx, acct, s)
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrapf(err, "Failed to connect to the %s repository", s.Provider))
|
||||
@ -564,17 +534,6 @@ func deleteExchangeCmd(cmd *cobra.Command, args []string) error {
|
||||
return Only(ctx, err)
|
||||
}
|
||||
|
||||
m365, err := acct.M365Config()
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to parse m365 account config"))
|
||||
}
|
||||
|
||||
logger.Ctx(ctx).Debugw(
|
||||
"Called - "+cmd.CommandPath(),
|
||||
"tenantID", m365.TenantID,
|
||||
"clientID", m365.ClientID,
|
||||
"hasClientSecret", len(m365.ClientSecret) > 0)
|
||||
|
||||
r, err := repository.Connect(ctx, acct, s)
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrapf(err, "Failed to connect to the %s repository", s.Provider))
|
||||
|
||||
@ -11,7 +11,6 @@ import (
|
||||
"github.com/alcionai/corso/internal/kopia"
|
||||
"github.com/alcionai/corso/pkg/account"
|
||||
"github.com/alcionai/corso/pkg/credentials"
|
||||
"github.com/alcionai/corso/pkg/logger"
|
||||
"github.com/alcionai/corso/pkg/repository"
|
||||
"github.com/alcionai/corso/pkg/storage"
|
||||
)
|
||||
@ -72,7 +71,6 @@ func s3InitCmd() *cobra.Command {
|
||||
// initializes a s3 repo.
|
||||
func initS3Cmd(cmd *cobra.Command, args []string) error {
|
||||
ctx := cmd.Context()
|
||||
log := logger.Ctx(ctx)
|
||||
|
||||
if utils.HasNoFlagsAndShownHelp(cmd) {
|
||||
return nil
|
||||
@ -93,14 +91,6 @@ func initS3Cmd(cmd *cobra.Command, args []string) error {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to parse m365 account config"))
|
||||
}
|
||||
|
||||
log.Debugw(
|
||||
"Called - "+cmd.CommandPath(),
|
||||
"bucket", s3Cfg.Bucket,
|
||||
"clientID", m365.ClientID,
|
||||
"hasClientSecret", len(m365.ClientSecret) > 0,
|
||||
"accessKey", s3Cfg.AccessKey,
|
||||
"hasSecretKey", len(s3Cfg.SecretKey) > 0)
|
||||
|
||||
r, err := repository.Initialize(ctx, a, s)
|
||||
if err != nil {
|
||||
if succeedIfExists && kopia.IsRepoAlreadyExistsError(err) {
|
||||
@ -139,7 +129,6 @@ func s3ConnectCmd() *cobra.Command {
|
||||
// connects to an existing s3 repo.
|
||||
func connectS3Cmd(cmd *cobra.Command, args []string) error {
|
||||
ctx := cmd.Context()
|
||||
log := logger.Ctx(ctx)
|
||||
|
||||
if utils.HasNoFlagsAndShownHelp(cmd) {
|
||||
return nil
|
||||
@ -160,14 +149,6 @@ func connectS3Cmd(cmd *cobra.Command, args []string) error {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to parse m365 account config"))
|
||||
}
|
||||
|
||||
log.Debugw(
|
||||
"Called - "+cmd.CommandPath(),
|
||||
"bucket", s3Cfg.Bucket,
|
||||
"clientID", m365.ClientID,
|
||||
"hasClientSecret", len(m365.ClientSecret) > 0,
|
||||
"accessKey", s3Cfg.AccessKey,
|
||||
"hasSecretKey", len(s3Cfg.SecretKey) > 0)
|
||||
|
||||
r, err := repository.Connect(ctx, a, s)
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to connect to the S3 repository"))
|
||||
|
||||
@ -9,7 +9,6 @@ import (
|
||||
"github.com/alcionai/corso/cli/options"
|
||||
. "github.com/alcionai/corso/cli/print"
|
||||
"github.com/alcionai/corso/cli/utils"
|
||||
"github.com/alcionai/corso/pkg/logger"
|
||||
"github.com/alcionai/corso/pkg/repository"
|
||||
"github.com/alcionai/corso/pkg/selectors"
|
||||
)
|
||||
@ -129,18 +128,6 @@ func restoreExchangeCmd(cmd *cobra.Command, args []string) error {
|
||||
return Only(ctx, err)
|
||||
}
|
||||
|
||||
m365, err := a.M365Config()
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrap(err, "Failed to parse m365 account config"))
|
||||
}
|
||||
|
||||
logger.Ctx(ctx).Debugw(
|
||||
"Called - "+cmd.CommandPath(),
|
||||
"backupID", backupID,
|
||||
"tenantID", m365.TenantID,
|
||||
"clientID", m365.ClientID,
|
||||
"hasClientSecret", len(m365.ClientSecret) > 0)
|
||||
|
||||
r, err := repository.Connect(ctx, a, s)
|
||||
if err != nil {
|
||||
return Only(ctx, errors.Wrapf(err, "Failed to connect to the %s repository", s.Provider))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user