-
Notifications
You must be signed in to change notification settings - Fork 26
Print all non-success output to STDERR #84
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
Conversation
18e781e
to
4755343
Compare
Copying from Slack, The motivation behind this is that I have a few scripts that either
to get the hostname to run bolt against or |
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.
Hey there 👋 thanks for the updates.
Generally, I think it's good to unify the output for vmfloaty to be consistent when printing messages for success or failure. However I think just putting STDOUT or STDERR in front of puts
will make this easy for future contributors to make a mistake and not be explicit. For that reason, I think it would make more sense to add a small message printer class and stop using puts all together (which is kind of an anti-pattern to use just puts for CLI tools anyway, I think).
This adds the Logger class for log output, all of which goes to STDERR, and uses puts to send only the command result to STDOUT.
f6b4dab
to
8ec9000
Compare
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.
Yay!! Thanks for all the updates, this looks better 😄 Just a small piece of feedback. I haven't given this the full test on my machine since I don't really have access to vmpooler, so if someone wanted to try that, that would be awesome!
This moves the instance of the logger class to a class variable in the `FloatyLogger` class and provides three class methods to log with in the rest of the project `FloatyLogger.info`, `FloatyLogger.warn`, and `FloatyLogger.error`.
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.
Thanks for making all those changes! :) looks good to me from a code perspective 👍
Status
Ready for Review
Description
This tries to move all
puts
output to STDERR, except if it's the successful output of a command. It was done almost entirely via search and replace so it could use a three-quarter to full-hearted review.Todos
Reviewers
@puppetlabs/dio
@highb
@briancain