karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Achim Nierbeck (JIRA)" <j...@apache.org>
Subject [jira] Commented: (KARAF-374) Clean up commands and remove System.out from them, simplify JANSI usage.
Date Tue, 11 Jan 2011 09:57:50 GMT

    [ https://issues.apache.org/jira/browse/KARAF-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980026#action_12980026
] 

Achim Nierbeck commented on KARAF-374:
--------------------------------------

One remark though, System.out are also printed to the wrapper.log file when running with the
service wrapper. 
I'm not sure the console output is printed there as well 

> Clean up commands and remove System.out from them, simplify JANSI usage.
> ------------------------------------------------------------------------
>
>                 Key: KARAF-374
>                 URL: https://issues.apache.org/jira/browse/KARAF-374
>             Project: Karaf
>          Issue Type: Improvement
>    Affects Versions: 2.1.2
>            Reporter: Ɓukasz Dywicki
>
> Currently we have two bad things in our commands. First is System.out.println() mix with
getConsole().println()
> Second thing is jansi usage. It is really cool to have colour output under Windows/Unix
shell but printing something with this library is a little hard. Fluent api in this case is
not the best choice:
> String str = Ansi.ansi()
>     .fg(Ansi.Color.RED)
>     .a("Command not found: ")
>     .a(Ansi.Attribute.INTENSITY_BOLD)
>     .a(((CommandNotFoundException) t).getCommand())
>     .a(Ansi.Attribute.INTENSITY_BOLD_OFF)
>     .fg(Ansi.Color.DEFAULT).toString();
> Instead of simple string tags:
> String str = new Ansi("[red]Command not found: [bold]" + ((CommandNotFoundException)
t).getCommand() +  "[/bold][/red]).toString(); 
> These two things are releated because we can simply wrap getConsole().println() with
jansi but System.out.println not.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message