15 lines
423 B
JavaScript
Executable file
15 lines
423 B
JavaScript
Executable file
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;
|