如何在 ant 脚本中重定向 stdout stderr?

编程入门 行业动态 更新时间:2024-10-15 00:25:33
本文介绍了如何在 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 等)自己提供此功能(通常通过 output 和 error 参数)

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

更多推荐

如何在 ant 脚本中重定向 stdout stderr?

本文发布于:2023-06-11 14:51:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/637058.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   重定向   如何在   stderr   ant

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!