Pitest:如何将日志输出重定向到文件?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Pitest:如何将日志输出重定向到文件?相关的知识,希望对你有一定的参考价值。

我使用Maite将Pitest(PIT)应用于Java项目以进行突变分析。控制台的管道操作员仅捕获与Maven相关的输出,但不通过PIT输出。 (这在Linux和Windows上都会发生。)

如何将控制台上显示的日志输出重定向到文件?

答案

Maven输出将转向stdout,而一些PIT日志将转向stderr。您还需要重定向stderr以获取所有日志。

# this will write both outputs to a file
mvn clean install &> both-outputs.log

# this will also write both outputs to a file
mvn clean install > both-outputs.log 2>&1

# to pipe both outputs you need to do this
mvn clean install 2>&1 | any-command-reading-from-stdin

以上是关于Pitest:如何将日志输出重定向到文件?的主要内容,如果未能解决你的问题,请参考以下文章