stream.dev.js 415 B

12345678910111213141516
  1. const isBrowser = typeof window !== 'undefined';
  2. let stream = undefined;
  3. // browser settings
  4. if (isBrowser) {
  5. const ConsoleFormattedStream = require('@browser-bunyan/console-formatted-stream').ConsoleFormattedStream;
  6. stream = new ConsoleFormattedStream();
  7. }
  8. // node settings
  9. else {
  10. const bunyanFormat = require('bunyan-format');
  11. stream = bunyanFormat({ outputMode: 'short' });
  12. }
  13. module.exports = stream;