stdout.js 418 B

1234567891011121314151617
  1. function stdoutAppender(layout, timezoneOffset) {
  2. return (loggingEvent) => {
  3. process.stdout.write(`${layout(loggingEvent, timezoneOffset)}\n`);
  4. };
  5. }
  6. function configure(config, layouts) {
  7. let layout = layouts.colouredLayout;
  8. if (config.layout) {
  9. layout = layouts.layout(config.layout.type, config.layout);
  10. }
  11. return stdoutAppender(layout, config.timezoneOffset);
  12. }
  13. exports.configure = configure;