Hi Joern,

Well, it's more of a java question than slf4j. The difference is between direct method call and a method call via reflection. The latter is known to be a bit slower and is also harder to read. There might also be subtle class loader differences.

Joern Huxhorn wrote:
I was wondering if there is a real substantial difference between

a) ILoggerFactory factory=org.slf4j.impl.StaticLoggerBinder.getLoggerFactory();

and

b) ILoggerFactory factory=(ILoggerFactory) Class.forName("org.slf4j.impl.StaticLoggerBinder").getMethod("getLoggerFactory").invoke(null);

I mean, are the classes resolved any different?

Beside a compile-time error in case of a) if the class is missing, of course.

Regards,
Joern.

--
Ceki
_______________________________________________
slf4j-dev mailing list
[email protected]
http://qos.ch/mailman/listinfo/slf4j-dev

Reply via email to