It definitely unnecessary code, so I think a bug-report is a good idea. 2013/1/10 Maarten Bosteels <[email protected]>
> Hello, > > > https://github.com/qos-ch/slf4j/blob/master/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java#L283 > > > > public void publish(LogRecord record) { > // Silently ignore null records. > if (record == null) { > return; > } > > > Logger slf4jLogger = getSLF4JLogger(record); > String message = record.getMessage(); // can be null! > // this is a check to avoid calling the underlying logging system > // with a null message. While it is legitimate to invoke j.u.l. with > // a null message, other logging frameworks do not support this. > // see also http://bugzilla.slf4j.org/show_bug.cgi?id=108 > if (message == null) { > message = ""; > } > if (slf4jLogger instanceof LocationAwareLogger) { > callLocationAwareLogger((LocationAwareLogger) slf4jLogger, record); > } else { > callPlainSLF4JLogger(slf4jLogger, record); > } > } > > > I don't understand the point of changing the local variable message to the > empty string since that local variable is not used afterwards. > Shouldn't this be like this : > > if (message == null) { > record.setMessage(""); > } > > Should a file a bug ? > > > Best regards > Maarten > > > _______________________________________________ > slf4j-user mailing list > [email protected] > http://mailman.qos.ch/mailman/listinfo/slf4j-user >
_______________________________________________ slf4j-user mailing list [email protected] http://mailman.qos.ch/mailman/listinfo/slf4j-user
