Sunday, November 4, 2012

SLF4J 1.7 and var-args

Logging logging... logging logging... this log entry doesn't contain complete informations.... ufff! ...new Object[]{....}

Are you bored? I think so. Yes log is something tedious and, in some situations, error prone especially using the log method with an array as input, for details see the post slf4j doesn't log exception stacktrace.

I'm happy to give you all some good news: from now we can avoid using the log methods with an array as input. With the new version of slf4j (version 1.7 and above) now everyone can use the var-args methods!
This can be seen as a minor improvement but it isn't; if you have red my post slf4j doesn't log exception stacktrace, that problem is vanished if you are using var-args methods, or slf4j 1.6 and above.

Conclusion: with slf4j 1.7 now we have var-args methods to log statement as you wish.

Bad news? SLF4j now supports Java 5 and above (imho: At last!).


Related posts:

2 comments:

  1. Your problem with the stack trace not showing was solved in v1.6.0 by the way. Not to say that varargs methods rule :-)

    Dale

    ReplyDelete