-
Notifications
You must be signed in to change notification settings - Fork 253
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
Text-only formatter option #120
Conversation
Thanks, but please don't push your pull request. This topic has come up a few times before, and the answer is always the same. If the implementation is the Thanks for the pull request in any case, perhaps you could look at fixing |
If I'm mistaken about the format, please choose a better name, and post a sample of the output, but it looks way, way too much like the |
This is not intended as a solution to the issues with term-ansicolor, but instead provides an option where colored output in any form is not desired (one example may be logging / log parsing for Capistrano used in an automated environment). There are no problems with the information itself, hence using the selectively verbose Pretty formatter as the basis, but rather the presentation of that information includes unnecessary formatting markers. At the time of writing this patch, there are only three options available: 1. Black Hole (i.e. no output) 2. Dot (i.e. minimal information with formatting markers) 3. Pretty (i.e. full information with formatting markers). There is, at present, no text-only formatter which can provide the information of Pretty without the color markers. I see "Text" as the complement to "Pretty". Not only does it provide functionality that cannot presently be achieved any other way, but it also defines "Pretty" as a colorized version of "Text". Lastly, it seems to me that the question for colorized vs plain text is genuinely a question of formatting, hence a separate formatter would be the appropriate course of action. If you do not agree, then I would appreciate some guidance from you on what degree of formatting changes would warrant a separate formatter, or what means would be recommended to provide a clean, text-only output format for SSHKit. Thank you. |
If TERM and
If a black and white screenshot of two formatters look the same, they shouldn't be two formatters. I think that's fair? Do you agree? (I'm more than happy to implement the correct behaviour in |
Ah, thank you for clarifying. I can see where you're coming from. Would a "Simple" or "Simplified" format be an acceptable alternative as something between the absolute minimalist "Dot" and the verbose "Pretty"? Something that looks like this (assuming a DEBUG level of verbosity):
Or for Info-only
|
If you don't mind calling it something like |
A bit late chiming in but I'll add my 2cs: A simple text (maybe PlainTextFormatter ?) is useful when automating. A good example is calling cap tasks within Jenkins. By default Jenkins does not handle ANSI codes and the logs come back a mess. There is a way around it (Jenkins has a plugin) but it is a bigger PITA. |
This is the point exactly of |
Ohh, and when you redirect the output through a pipe, the |
Well at least until term-ansicolor works as desired, the SimpleText formatter has been built, rebased, and pushed up for your review. Thank you. |
A text-only (i.e. without color) formatter option that cleans up the output when using SSHKit via GitBash on Windows (or via any other terminal that does not understand ANSI color codes)
Can be used in Capistrano's deploy.rb via:
set :format, :text