如何在3.4+版本中禁用JooQ的自广告消息? [英] How to disable JooQ's self-ad message in 3.4+?
问题描述
我是JooQ的忠实拥护者,但是不幸的是,由于从3.3升级,每次我的代码退出之前,它都会在控制台上显示一条非常烦人的消息:
I'm a big fan of JooQ, but unfortunately since upgrading from 3.3 it prints a very annoying message to the console each time before my code exits:
Feb 02, 2015 7:28:06 AM org.jooq.tools.JooqLogger info
INFO:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<snip>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Thank you for using jOOQ 3.5.1
很遗憾,我根本无法删除此日志.
Unfortunately I cannot manage to remove this log at all.
请注意,我既不使用slf4j,也不使用log4j或任何日志API;因此,我唯一可用的机制是j.u.l.
Note that I don't use slf4j, nor log4j nor any log API; therefore the only mechanism I have available is j.u.l.
我尝试使用此功能完全禁用它:
I have tried to disable it completely using this:
static {
Stream.of(Logger.getAnonymousLogger(), Logger.getGlobal(),
Logger.getLogger("org.jooq.tools.JooqLogger")
).forEach(l -> {
l.setLevel(Level.OFF);
final Handler[] handlers = l.getHandlers();
Arrays.stream(handlers).forEach(l::removeHandler);
});
}
不幸的是,它不起作用,消息仍然出现.
Unfortunatley, it doesn't work, the message still appears.
如何在不修改代码的情况下使此消息消失?
How do I make this message disappear short of modifying the code, which I want to avoid here?
推荐答案
这似乎对我有用:
static {
LogManager.getLogManager().reset();
}
This is also indicated as a solution a couple of times in this Stack Overflow question.
请注意,版本3.6+也将附带系统属性,可用于停用此功能徽标:
Note that version 3.6+ will also ship with a system property that can be used to deactivate displaying this logo:
-Dorg.jooq.no-logo=true
这篇关于如何在3.4+版本中禁用JooQ的自广告消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!