2012-01-05 21:47:15 +08:00
|
|
|
var layouts = require('../layouts'),
|
|
|
|
consoleLog = console.log;
|
2011-07-24 19:58:02 +08:00
|
|
|
|
|
|
|
function consoleAppender (layout) {
|
|
|
|
layout = layout || layouts.colouredLayout;
|
|
|
|
return function(loggingEvent) {
|
2012-01-05 21:47:15 +08:00
|
|
|
consoleLog(layout(loggingEvent));
|
2011-07-24 19:58:02 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function configure(config) {
|
|
|
|
var layout;
|
|
|
|
if (config.layout) {
|
|
|
|
layout = layouts.layout(config.layout.type, config.layout);
|
|
|
|
}
|
|
|
|
return consoleAppender(layout);
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.appender = consoleAppender;
|
|
|
|
exports.configure = configure;
|