stderr.js 425 B

1234567891011121314151617
  1. function stderrAppender(layout, timezoneOffset) {
  2. return (loggingEvent) => {
  3. process.stderr.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 stderrAppender(layout, config.timezoneOffset);
  12. }
  13. module.exports.configure = configure;