An abstract class to make it easy to build loggers.
It provides log level handling, and de-multiplexes all the method calls
onto a single method that takes two parameters: the name of the method ('trace'/'debug'/'info', etc)
and an array of the arguments passed to that method.
To use it, you can either extend this class and override the log method or pass another logger
to delegate to into the constructor, or finally you can pass a log method directly into the constructor.
The caplin logging scheme allows the logData to have a template string as the first item. You can
convert a logData into a string using the method this.logDataToString from inside your log method.
By default there is no data or log level information added into that string, so you will most
probably want to prepend the time and level. Here is a simple example that logs to the console (although
if you wish to do this, check out caplin.core.log.ConsoleLogger):
function MyLogger() {
caplin.core.log.AbstractLogger.call(this);
}
caplin.extend(MyLogger, caplin.core.log.AbstractLogger);
MyLogger.prototype.log = function(level, logData) {
console.log(new Date().toISOString(), level, this.logDataToString(logData));
};