蚂蚁EXEC:重定向标准出来,但没有标准错误 [英] Ant exec: redirecting standard out but not standard error

查看:157
本文介绍了蚂蚁EXEC:重定向标准出来,但没有标准错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 EXEC 任务,它的输出,我投入的属性使用 outputproperty 属性。该命令可以打印一些错误到std​​err,我不希望被包含在输出中的错误(由于输出被馈送到另一个命令),而是要打印输出给用户。所以我重定向输出和错误到单独的属性和回声 error属性。这似乎样的黑客不得不回声的错误。是否有可能重定向一个exec的输出,但留在标准错误或标准输出错误?我认为这意味着错误属性设置为一些神奇的价值,但我想不出该值是什么。

I have an exec task whose output I am putting into a property using the outputproperty attribute. The command may print some errors to stderr, I do not want the errors to be included in the output (since the output is being fed into another command) but rather to be printed out to the user. So I am redirecting the output and error into separate properties and echo the error property. It seems kind of a hack to have to echo the error. Is it possible to redirect the output of an exec but leave error on stderr or stdout? I assume it means setting the error attribute to some magical value but I cannot figure out what that value is.

推荐答案

尝试删除错误 errorproperty 属性和加入 LOGERROR =真正的

Try removing error or errorproperty attributes and adding logError="true".

请参阅http://ant.apache.org/manual/Tasks/exec.html

这篇关于蚂蚁EXEC:重定向标准出来,但没有标准错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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