JAVA日志信息在命令行输出带颜色的字符串是怎么实现的

我在使用 java.util.logging.Logger 这个东西的时候发现在输出日志时在命令行显示的是红色的文字 . 例如:

 

2009-2-18 16:13:24 cn.iamsese.product.custom.reflect.common.ReflectConsole log
信息: 日志测试

 

请问在命令行输出这种带颜色的字符串,是怎么做到的啊??

 

 

 


问题补充:
感谢 yucc77 的回答,但是我要的不是设置输出控制台的颜色.

因为在使用System.out.println("hello");它输出的是黑色的:
hello

而使用了日志Logger的log方法来输出,就是有颜色的 如上

google找到的:
[b][color=red]the default console handler of java.util.logging prints messages
to System.err, and therefor Eclipse renders them red[/color][/b].
你可以通过修改eclipse里的console配色(当然这也影响了其他标准err输出的颜色),或者就是扩展ConsoleHandler :
[code="java"]class myConsoleHandler extends ConsoleHandler {
public myConsoleHandler() {
super();
this.setOutputStream(System.out);
}
}[/code]
更可取的方法是直接使用log4j,可配置的

你是指Eclipse吗,可以设置console的属性来改变颜色的。
当然,如果你的意思是可以在程序里控制输出颜色的话,我觉得应该是不能