log4js-node/lib/appenders/console.js
2013-05-25 14:00:06 +10:00

22 lines
478 B
JavaScript

"use strict";
var layouts = require('../layouts')
, consoleLog = console.log;
function consoleAppender (layout) {
layout = layout || layouts.colouredLayout;
return function(loggingEvent) {
consoleLog(layout(loggingEvent));
};
}
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;