fwcd / kotlin-language-server

Kotlin code completion, diagnostics and more for any editor/IDE using the Language Server Protocol
MIT License
1.58k stars 202 forks source link

Suppress a warning around SLF4J #569

Open yuk1ty opened 4 months ago

yuk1ty commented 4 months ago

(I'm not sure where I should write this kind of discussion so I filed an issue. This issue is just a proposal for the maintainer; not a bug stuff πŸ‘πŸ»)

We can see the following log when we launch the server (and there are lots of mentions in issues of this repo):

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

I propose that it should be ok if we suppress this warning by adding slf4j-nop into dependencies. The kotlin-language-server seems to be mainly taking advantage of java.util.logging.Logger as far as I know. I tried to add it on my local machine and the removal was working fine. The page in the message says the following thing as well:

If you are responsible for packaging an application and do not care about logging, then placing slf4j-nop.jar on the class path of your application will get rid of this warning message

What do you think about that? If that seems to be ok, I would like to work on this!

fwcd commented 4 months ago

I agree that it would be best to get rid of the warning, but ideally we should forward those messages to JUL too, so they get picked up by own our logging pipeline.

SkrrtBacharach commented 3 months ago

I'm really not familiar with how Java/Kotlin do logging, but is there a reason why slf4j-api.jar is included in the deps at all?

fwcd commented 3 months ago

Libraries often use SLF4J as their logging API