SimpleLogging - Simple Logging Library which Backends to Standard Loggers

I've written this code into a number of different libraries of mine including ORMLite and I have decided that it is worth it's own release. The goal is a small-ish library that backends to a number of standard logging packages. This allows you to write your code and include log messages without having a fixed dependency on any one logging package. I include this code into my libraries and so they can stay agnostic. I understand that this is the goal of commons-logging as well but I really want the slf4j-style {} arguments which aren't supported. This logging code allows you to write messages with the {} support and then backend to a number of other logging libraries or you can easily implement your own. It also handles arrays appropriately and supports up to 4 arguments before forcing the caller to pass in an object array.

Simple Code Sample

The following is a quick code sample to help you get started using the logging library.

// usually a logger will be per-class, getLogger() also can take a String label
private static final Logger logger = LoggerFactory.getLogger(MyClass.class);
// log trace message with arguments. toString() on the args only called if trace messages enabled
logger.trace("some trace information: {} and {}", arg1, arg2);
// NOTE: exception argument comes _before_ the message format to not confuse the arguments
logger.error(exception, "http client threw getting URL: {}", url);

Free Spam Protection   Android ORM   Simple Java Magic   JMX using HTTP   Great Eggnog Recipe   Massachusetts Covid Vaccine Sites