gpt4 book ai didi

playframework - 运行 Play 命令时如何关闭颜色代码?

转载 作者:行者123 更新时间:2023-12-04 05:47:08 25 4
gpt4 key购买 nike

当我运行 Play 命令时,终端中的日志颜色很好且干净,但是当我在 Jenkins 中构建我的应用程序时,那里的日志显示颜色代码,使它们非常难以阅读。

命令行日志:

[info] ApplicationSpec
[info] Application should
[info] + send 404 on a bad request
[info] x render the index page
[error] '401' is not equal to '200' (ApplicationSpec.scala:25)
[info] Total for specification ApplicationSpec
[info] Finished in 134 ms
[info] 2 examples, 1 failure, 0 error
[error] Failed: Total 3, Failed 2, Errors 0, Passed 1
[error] Failed tests:
[error] ApplicationSpec
[error] IntegrationSpec
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 23 s, completed Mar 26, 2014 10:00:34 AM

Jenkins 日志:
[0m[[0minfo[0m] [0mApplicationSpec[0m
[0m[[0minfo[0m] [0mApplication should[0m
[0m[[0minfo[0m] [0m[32m+[0m send 404 on a bad request[0m
[0m[[0minfo[0m] [0m[33mx[0m render the index page[0m
[0m[[31merror[0m] [0m '401' is not equal to '200' (ApplicationSpec.scala:25)[0m
[0m[[0minfo[0m] [0mTotal for specification ApplicationSpec[0m
[0m[[0minfo[0m] [0m[34mFinished in 229 ms[0m[0m
[0m[[0minfo[0m] [0m[34m2 examples, 1 failure, 0 error[0m[0m
[0m[[31merror[0m] [0mFailed: Total 3, Failed 2, Errors 0, Passed 1[0m
[0m[[31merror[0m] [0mFailed tests:[0m
[0m[[31merror[0m] [0m ApplicationSpec[0m
[0m[[31merror[0m] [0m IntegrationSpec[0m
[0m[[31merror[0m] [0m(test:[31mtest[0m) sbt.TestsFailedException: Tests unsuccessful[0m
[0m[[31merror[0m] [0mTotal time: 6 s, completed Mar 25, 2014 2:28:01 PM[0m

如您所见,Jenkins 输出仍然具有相同的内容,但颜色代码使其非常嘈杂,以至于很难弄清楚发生了什么。

我找到了 limited information关于如何关闭 SBT 工具的颜色代码,但我不知道如何通过 play 传递它通过 Jenkins 运行我的构建时的命令。

最佳答案

或者您可以安装 Ansi-Color Jenkins 插件,实际上 有颜色在你的 Jenkins 日志中

关于playframework - 运行 Play 命令时如何关闭颜色代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22665543/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com