如何在 ant 脚本中重定向 stdout stderr? [英] How to redirect stdout stderr in an ant script?

查看:26
本文介绍了如何在 ant 脚本中重定向 stdout stderr?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在触发一个蚂蚁脚本(通过巡航控制),并且希望能够将特定蚂蚁目标的 std 输出和 std 错误 转储到一个纯文本文件.

I am triggering an ant script (via cruise control), and would like to be able to dump the std out and std err for a particular ant target to a plain text file.

是的,我知道巡航控制系统已经维护了一个包含此信息(以及许多其他信息)的 XML 日志文件,但出于可移植性的原因,我需要从 ant 脚本本身实现这一点.

Yes, I am aware that cruise control already does maintain an XML log file containing this information (among many other things), but for portability reasons, I need this to happen from the ant script itself.

这可能吗,如果可能,该怎么做?

Is this possible, and if so, how to do it?

非常感谢!

推荐答案

记录器 任务也许可以做你想做的事:

The recorder task may be able to do what you want:

<record name="log.txt" action="start"/>
...
<record name="log.txt" action="stop"/>

除此之外,某些任务(exec、java 等)自己提供此功能(通常通过 outputerror 参数)

Beyond that, certain tasks (exec, java, etc) offer this functionality by themselves (usually by means of output and error arguments)

这篇关于如何在 ant 脚本中重定向 stdout stderr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆