【问题标题】:How can I change serenity-bdd log settings in maven如何更改 maven 中的 serenity-bdd 日志设置
【发布时间】:2018-02-24 00:15:34
【问题描述】:

使用 serenity-bdd,日志分析很重要。但是日志中有很多垃圾邮件:

Serenety 在伐木女巫中使用了很多 asci 艺术,在我看来是浪费空间并产生很多噪音:

end2endtests    |  _____ _____ ____ _____   ____ _____  _    ____ _____ _____ ____  
end2endtests    | |_   _| ____/ ___|_   _| / ___|_   _|/ \  |  _ \_   _| ____|  _ \ 
end2endtests    |   | | |  _| \___ \ | |   \___ \ | | / _ \ | |_) || | |  _| | | | |
end2endtests    |   | | | |___ ___) || |    ___) || |/ ___ \|  _ < | | | |___| |_| |
end2endtests    |   |_| |_____|____/ |_|   |____/ |_/_/   \_\_| \_\|_| |_____|____/ 
end2endtests    |                                                                   
end2endtests    |                                                                   

最后我们得到:

end2endtests    |         __    _____ _____ ____ _____   ____   _    ____  ____  _____ ____  
end2endtests    |   _     \ \  |_   _| ____/ ___|_   _| |  _ \ / \  / ___|/ ___|| ____|  _ \ 
end2endtests    |  (_)_____| |   | | |  _| \___ \ | |   | |_) / _ \ \___ \\___ \|  _| | | | |
end2endtests    |   _|_____| |   | | | |___ ___) || |   |  __/ ___ \ ___) |___) | |___| |_| |
end2endtests    |  (_)     | |   |_| |_____|____/ |_|   |_| /_/   \_\____/|____/|_____|____/ 
end2endtests    |         /_/                                                                
end2endtests    | 
end2endtests    | TEST PASSED

我们在 Jenkins 服务器中通过 Maven 命令执行此操作,我真的很想减少这种噪音,因此我们的日志记录和 sutch 会少一些。我一直在搜索它,但还没有找到一个明确的答案,让我有洞察力。

【问题讨论】:

    标签: maven docker jenkins serenity-bdd


    【解决方案1】:

    您需要在命令行中传递-Dserenity.console.headings=minimal-Dserenity.console.headings=normal

    或者使用

    System.SetProperty("serenity.console.headings", "normal");
    

    详情见下文

    http://thucydides.info/docs/serenity-staging/

    【讨论】:

      【解决方案2】:

      您可以使用 serenity.properties 文件中的以下属性来关闭登录报告。 (Serenity 模型/核心版本:2.2.5)

      serenity.console.headings=none 关闭 TEST STARTED 横幅,s​​erenity.console.banner=none 关闭 SERENITY BDD 横幅。

      参考: https://www.javadoc.io/doc/net.serenity-bdd/serenity-model/latest/net/thucydides/core/ThucydidesSystemProperty.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-06-23
        • 1970-01-01
        • 1970-01-01
        • 2016-06-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-22
        相关资源
        最近更新 更多