Kargi-Sitesi/node_modules/log4js/lib/appenders/console.js

19 lines
494 B
JavaScript
Raw Normal View History

2024-11-04 02:30:09 +00:00
// eslint-disable-next-line no-console
const consoleLog = console.log.bind(console);
function consoleAppender(layout, timezoneOffset) {
return (loggingEvent) => {
consoleLog(layout(loggingEvent, timezoneOffset));
};
}
function configure(config, layouts) {
let layout = layouts.colouredLayout;
if (config.layout) {
layout = layouts.layout(config.layout.type, config.layout);
}
return consoleAppender(layout, config.timezoneOffset);
}
module.exports.configure = configure;