Skip to content

Commit

Permalink
Merge pull request #7115 from a-hilaly/logs-wv
Browse files Browse the repository at this point in the history
Refine log statements using `%w` for better formatting and UX
  • Loading branch information
Himangini committed Sep 28, 2023
2 parents 54c88a4 + fbf2729 commit 8cf3bda
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integration/tests/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (p *Params) attemptSettingUserID() {
},
})

msg := "Warning: failed to get UserID, proceeding without configuring cluster name prefix. Error: %w"
msg := "Warning: failed to get UserID, proceeding without configuring cluster name prefix. Error: %v"
if err != nil {
fmt.Fprintf(GinkgoWriter, msg, err)
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/cluster/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,6 @@ func attemptVpcCniDeletion(ctx context.Context, clusterConfig *api.ClusterConfig
logger.Debug("deleting kube-system/aws-node DaemonSet")
err := clientSet.AppsV1().DaemonSets("kube-system").Delete(ctx, "aws-node", metav1.DeleteOptions{})
if err != nil {
logger.Debug("failed to delete kube-system/aws-node DaemonSet: %w", err)
logger.Debug("failed to delete kube-system/aws-node DaemonSet: %v", err)
}
}
2 changes: 1 addition & 1 deletion pkg/actions/nodegroup/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (m *Manager) Drain(ctx context.Context, input *DrainInput) error {
}
err := g.Wait()
if err != nil {
logger.Critical("Node group drain failed: %w", err)
logger.Critical("Node group drain failed: %v", err)
}
waitForAllRoutinesToFinish(ctx, sem, parallelLimit)
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/nodegroup/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (m *Manager) mapStackToNodeGroupSummary(ctx context.Context, stack *manager
}
collectorSet := outputs.NewCollectorSet(collectors)
if err := collectorSet.MustCollect(*stack); err != nil {
logger.Warning(fmt.Errorf("error collecting Cloudformation outputs for stack %s: %w", *stack.StackName, err).Error())
logger.Warning("error collecting Cloudformation outputs for stack %s: %v", *stack.StackName, err)
}
}

Expand Down

0 comments on commit 8cf3bda

Please sign in to comment.