java-native / jssc

Java library for talking to serial ports (with added build support for maven, cmake, MSVC)
https://discord.gg/RBsUfE9sX9
GNU Lesser General Public License v3.0
164 stars 53 forks source link

Error at begin on Windows 10 #167

Open aayes89 opened 4 months ago

aayes89 commented 4 months ago

Shows errors in console when running project using NetBeans 21:

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.

Taking a look, in the library, the referenced class is not present

hiddenalpha commented 4 months ago

Works as designed as far as I see :)

This is slf4j informing that no logger is configured. More details about this behavior is documented in slf4j manual > libraries. It does not affect the working of jssc itself.

Cited from slf4j doc:

SLF4J version 1.6.0 and later will emit a single warning message about the absence of a binding and proceed to discard all log requests without further protest

If logging is wanted an app can add a logger implementation to the classpath and configure it according to the implementations documentation. Usually this is the way to go.

If no logs are wanted, we're already done. slf4j won't log anymore after this warning. To suppress this log too, an app can decide to add a so called no-op (no-operation) logger to the classpath. Such a no-op implementation is also listed at slf4j manual named slf4j-nop (eg available at mvnrepository.com or as jar).

But be aware: I personally am not a fan of no-op loggers, as they conceal potentially helpful error details. Only use one of those if suppressing of all logs really is the desired behavior.