如何在Apache Ant中默认启用AnsiColorLogger?

时间:2016-02-16 15:42:27

标签: apache logging ant

如何默认启用AnsiColorLogger Apache Ant内置 logger ,而无需手动运行命令ant -logger org.apache.tools.ant.listener.AnsiColorLogger或添加环境变量ANT_ARGS

我试图从ant build运行命令。
的build.xml

<exec dir="${sdk.dir}" executable="cmd">
    <arg value="${sdk.dir}" />
    <arg value="AnsiColorLogger.cmd" />
</exec>

AnsiColorLogger.cmd

START -logger org.apache.tools.ant.listener.AnsiColorLogger

然后我运行ant命令来编译我的项目,但日志没有着色。

Fuiba@FUIBA D:\DEV\TEST\proj
> ant
Buildfile: D:\DEV\TEST\proj\build.xml
Trying to override old definition of task for
     [exec] Microsoft Windows [Versione 10.0.10240]
     [exec] (c) 2015 Microsoft Corporation. Tutti i diritti sono riservati.
     [exec]
     [exec] Fuiba@FUIBA D:\DEV\TEST\proj
     [exec] >

相反,当我运行ant -logger org.apache.tools.ant.listener.AnsiColorLogger时,它就可以了。

0 个答案:

没有答案