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

问题描述 投票:0回答:1

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

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

console pipe pitest
1个回答
0
投票

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
© www.soinside.com 2019 - 2024. All rights reserved.