Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

unmanaged-cluster: add line break after error output #2839

Merged
merged 1 commit into from
Jan 13, 2022
Merged

unmanaged-cluster: add line break after error output #2839

merged 1 commit into from
Jan 13, 2022

Conversation

joshrosso
Copy link
Contributor

What this PR does / why we need it

This inserts a line break when an error is returned to the calling
client (cmd packag). It improves readability as PS1 of the terminal will
not start at the end of the error message.

Describe testing done for PR

Prior to this change, outputs like the following occurred.

image

image

With these changes, we now see an appropriate break, improving readability.

image

Special notes for your reviewer

This is a minor enough change where-in if @jpmcb or @stmcginnis do not have any suggestions, it can be approved and merged.

This inserts a line break when an error is returned to the calling
client (cmd packag). It improves readability as PS1 of the terminal will
not start at the end of the error message.

Signed-off-by: joshrosso <[email protected]>
@joshrosso joshrosso requested review from stmcginnis and jpmcb January 13, 2022 16:11
@joshrosso joshrosso requested a review from a team as a code owner January 13, 2022 16:11
@@ -106,7 +106,7 @@ func create(cmd *cobra.Command, args []string) error {
tm := tanzu.New(log)
err = tm.Deploy(clusterConfig)
if err != nil {
log.Error(err.Error())
log.Errorf("%s\n", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative here would be to change the log.Error method to:

+ fmt.Println(message)
- fmt.Print(message)

but I'm also good with your change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's revisit this option as an enhancement to the log package.

@joshrosso joshrosso merged commit 5dd6df8 into vmware-tanzu:standalone-overhaul Jan 13, 2022
joshrosso pushed a commit that referenced this pull request Jan 18, 2022
This inserts a line break when an error is returned to the calling
client (cmd packag). It improves readability as PS1 of the terminal will
not start at the end of the error message.

Signed-off-by: joshrosso <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants