15 lines
416 B
JavaScript
Executable file
15 lines
416 B
JavaScript
Executable file
function stdoutAppender(layout, timezoneOffset) {
|
|
return (loggingEvent) => {
|
|
process.stdout.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 stdoutAppender(layout, config.timezoneOffset);
|
|
}
|
|
|
|
exports.configure = configure;
|