-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
status: remove extra empty line logging #107
Conversation
for _, cr := range allCRs { | ||
logging.Info(cr) | ||
command := fmt.Sprintf(scriptPrintSpecificCRStatus, clusterNamespace, cr) | ||
logging.Info(exec.ExecuteBashCommand(command)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging.Info()
is printing "Info:" with no other info for other commands besides the example given in the issue. Instead of changing the implementation here, try just change inside the logging.Info()
method to only print a blank line if there is no message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be good now
changing Info() method to print `Info` and logs with new line only when output is not empty otherwise it will print `Info:` with empty line. Signed-off-by: subhamkrai <srai@redhat.com>
ce1b160
to
df1ab8b
Compare
if output != "" { | ||
fmt.Print(blue("Info: ")) | ||
fmt.Printf(output, args...) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a blank line will still be helpful if it's blank
} | |
} else { | |
fmt.Println() | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is already new line
kubectl-rook-ceph/pkg/logging/log.go
Lines 26 to 32 in df1ab8b
blue := color.New(color.FgBlue).SprintFunc() | |
if output != "" { | |
fmt.Print(blue("Info: ")) | |
fmt.Printf(output, args...) | |
} | |
fmt.Println() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, I overlooked it, thanks
if output != "" { | ||
fmt.Print(blue("Info: ")) | ||
fmt.Printf(output, args...) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, I overlooked it, thanks
status: remove extra empty line logging
changing Info() method to print
Info
andlogs with new line only when output is not empty
otherwise it will print
Info:
with empty line.fixes: #102