createLogger.js 365 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const log = require('webpack-log');
  3. function createLogger(options = {}) {
  4. let level = options.logLevel || 'info';
  5. if (options.noInfo === true) {
  6. level = 'warn';
  7. }
  8. if (options.quiet === true) {
  9. level = 'silent';
  10. }
  11. return log({
  12. name: 'wds',
  13. level,
  14. timestamp: options.logTime,
  15. });
  16. }
  17. module.exports = createLogger;