如何在码头中禁用 slf4j

How to disable slf4j in jetty

我正在使用自代码记录器,我不想实现 slf4j。

Jetty 将打印:

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.

如何禁用这个愚蠢的输出?

我没有使用 Spring 或类似的东西。我只是导入码头库并打印...

使用 slf4j-nop 记录器

将其添加到 build.gradle

的依赖块中

科特林 DSL:

implementation("org.slf4j:slf4j-nop:2.0.0-alpha1")