Skip to content

Commit

Permalink
chore: simple print logger
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwelbm committed May 21, 2024
1 parent db33e3f commit cbdc52f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pkg/cmd/delete/edge_storage/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/aziontech/azion-cli/utils"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"go.uber.org/zap"
)

func NewBucket(f *cmdutil.Factory) *cobra.Command {
Expand Down Expand Up @@ -56,14 +55,14 @@ func (b *bucket) runE(cmd *cobra.Command, _ []string) error {
return nil
}
}
logger.Info("Delete all objects bucket", zap.Any("bucket-name", b.name))
logger.FInfo(b.factory.IOStreams.Out, fmt.Sprintf("Delete all objects bucket\n"))
if err := deleteAllObjects(client, ctx, b.name, ""); err != nil {
return err
}
err := client.DeleteBucket(ctx, b.name)
if err != nil {
if msg.ERROR_NO_EMPTY_BUCKET == err.Error() {
logger.Info("schedules a delete for the bucket", zap.Any("bucket-name", b.name))
logger.FInfo(b.factory.IOStreams.Out, fmt.Sprintf("schedules a delete for the bucket: %s", b.name))
return schedule.NewSchedule(b.name, schedule.DELETE_BUCKET)
} else {
return fmt.Errorf(msg.ERROR_DELETE_BUCKET, err.Error())
Expand Down
2 changes: 1 addition & 1 deletion pkg/output/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"strings"

"github.com/aziontech/azion-cli/pkg/logger"
"github.com/fatih/color"
"github.com/aziontech/tablecli"
"github.com/fatih/color"
)

type ListOutput struct {
Expand Down

0 comments on commit cbdc52f

Please sign in to comment.