You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
425 B
17 lines
425 B
|
|
|
|
function stderrAppender(layout, timezoneOffset) {
|
|
return (loggingEvent) => {
|
|
process.stderr.write(`${layout(loggingEvent, timezoneOffset)}\n`);
|
|
};
|
|
}
|
|
|
|
function configure(config, layouts) {
|
|
let layout = layouts.colouredLayout;
|
|
if (config.layout) {
|
|
layout = layouts.layout(config.layout.type, config.layout);
|
|
}
|
|
return stderrAppender(layout, config.timezoneOffset);
|
|
}
|
|
|
|
module.exports.configure = configure;
|