[英]How to avoid undesired “animated” console output on Jenkins
Sometimes I find log-lines like these in my Jenkins Job Output: 有时,我在Jenkins Job Output中找到这样的日志行:
[|] [/] [-] [\] [|] [/] [-] [\] [|] [/] [-]
I know these lines come from a "Progress Spinner" ( https://askubuntu.com/questions/623933/how-to-create-a-rotation-animation-using-shell-script ) but they look weird in a plain-text log. 我知道这些行来自“ Progress Spinner”( https://askubuntu.com/questions/623933/how-to-create-a-rotation-animation-using-shell-script ),但在纯文本中看起来很奇怪文字记录。
It gets worse, when a tool uses a "command line progress bar" which comes eg when pulling a Docker Image or an NPM package - then the log contains real ugly (and unnecessary) log blocks. 更糟糕的是,当工具使用“命令行进度条”时(例如,拉出Docker Image或NPM软件包时),该日志包含真正的丑陋(且不必要)的日志块。
...
xtracting [=============> ] 15.2 MB/50.31 MB
xtracting [==============> ] 15.2 MB/50.31 MB
xtracting [===============> ] 15.2 MB/50.31 MB
xtracting [================> ] 15.2 MB/50.31 MB
xtracting [=================> ] 15.2 MB/50.31 MB
----
Is there any Jenkins Plugin existing (like the Ansi-Color Plugin ) which either shows the animation or shrinks the output to the final "position" ? 是否存在任何可以显示动画或将输出缩小到最终“位置”的Jenkins插件(如Ansi-Color插件 )?
I don't want to use every tool in "quiet" mode just to skip these unnecessary "ascii arts" because a lot of interesting information gets lost then. 我不想在“安静”模式下使用所有工具只是为了跳过这些不必要的“ ascii arts”,因为那样会丢失很多有趣的信息。
This is an interesting subject but I am afraid that there is almost nothing safe you can do to "compress" the output if the tool didn't detect the TTY properly. 这是一个有趣的话题,但是如果工具没有正确检测到TTY,恐怕几乎没有安全的方法可以用来“压缩”输出。
Here are the workarounds: 以下是变通办法:
-q
or --silent
-q
或--silent
类的开关
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.