gpt4 book ai didi

eclipse - 如何让 Logback 在 Eclipse 控制台中以红色记录 stderr?

转载 作者:行者123 更新时间:2023-12-03 21:39:05 25 4
gpt4 key购买 nike

我曾经有一个博客链接,该链接展示了如何在 logback.xml 文件中配置 Logback,以便在 Eclipse 控制台中警告和严重级别以红色显示,其他级别以黑色显示。

由于某些公司防火墙问题,我现在似乎无法访问 Google(Bing 似乎正在工作)。任何人都有如何做到这一点的链接?

最佳答案

您必须配置 logback 以登录到 stderr。 Eclipse 将以红色显示这些行。

但我强烈建议您使用 Grep Console Plugin :

Grep Console allows you to define a series of regular expressions which will be tested against the console output. Each expression matching a line will affect the style of either the entire line or parts of it. For example, error messages could be set to show up with a red background, or integer values showing the state of a certain variable could be rendered in bold font.



这个插件的优点是你可以用不同的颜色突出不同的日志级别。我还突出显示了属于我的类的堆栈跟踪中的行。这使得在堆栈跟踪中查找相关行变得更加容易。

Screenshot

关于eclipse - 如何让 Logback 在 Eclipse 控制台中以红色记录 stderr?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13167007/

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