-
Notifications
You must be signed in to change notification settings - Fork 35
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
Colorize LogMessages again #94
Comments
Thanks for the idea! Could you show me a screenshot of some Airbrussh output that shows what your changes look like? I'm particularly interested in examples of error messages you are colorizing. If you are referring to stderr command output, I don't want to color stderr red because stderr is not necessary error messages. Often times it is just debug messages or progress indication. Colorizing those in red would give the user the mistaken impression that something has gone wrong. This was one problem in Capistrano's |
Alright, here is how it looks (OS X Terminal): This is with the code from above, in my Commit (https://github.com/klyonrad/airbrussh/commit/8b57a477cdc555fae6b3b571e1136cc92da87c98) I only colorized the verbosity Label, which makes more sense.
I didn't check for that, but judging from the Code the def write(obj)
case obj
when SSHKit::Command
log_command_start(obj)
log_and_clear_command_output(obj, :stderr)
log_and_clear_command_output(obj, :stdout)
log_command_exit(obj) if obj.finished?
when SSHKit::LogMessage
write_log_message(obj)
end
end |
Thanks for the screenshot. I'm willing to accept a PR that adds a colorized |
With the old pretty formatter, the Message Level (fatal, error, warn, info...) was colorized. That made it quite easy for the human eye to see where the error messages are.
I wrote an informal patch that overrides the
write_log_message
method inCommandFormatter
to restore the old colorize behaviour. It combines code from SSHKIT ( https://github.com/capistrano/sshkit/blob/v1.11.2/lib/sshkit/formatters/pretty.rb#L44 ) with theAirbrussh::Colors
method.Would you like a Pull Request for this change?
This change is also available in my fork in the branch
colorize-logmessage
https://github.com/klyonrad/airbrussh/tree/colorize-logmessageThe text was updated successfully, but these errors were encountered: