Sha256: 620f9e732e4278dafc6b9d37063aa35f2b031511ecbed5991c29f07c78775f4d

Contents?: true

Size: 964 Bytes

Versions: 26

Compression:

Stored size: 964 Bytes

Contents

'use strict';

var log = require('loglevel').getLogger('webpack-dev-server');

var INFO = 'info';
var WARN = 'warn';
var ERROR = 'error';
var DEBUG = 'debug';
var TRACE = 'trace';
var SILENT = 'silent'; // deprecated
// TODO: remove these at major released
// https://github.com/webpack/webpack-dev-server/pull/1825

var WARNING = 'warning';
var NONE = 'none'; // Set the default log level

log.setDefaultLevel(INFO);

function setLogLevel(level) {
  switch (level) {
    case INFO:
    case WARN:
    case ERROR:
    case DEBUG:
    case TRACE:
      log.setLevel(level);
      break;
    // deprecated

    case WARNING:
      // loglevel's warning name is different from webpack's
      log.setLevel('warn');
      break;
    // deprecated

    case NONE:
    case SILENT:
      log.disableAll();
      break;

    default:
      log.error("[WDS] Unknown clientLogLevel '".concat(level, "'"));
  }
}

module.exports = {
  log: log,
  setLogLevel: setLogLevel
};

Version data entries

26 entries across 25 versions & 8 rubygems

Version Path
ezii-os-5.2.1 node_modules/webpack-dev-server/client/utils/log.js
ezii-os-2.0.1 node_modules/webpack-dev-server/client/utils/log.js
ezii-os-1.1.0 node_modules/webpack-dev-server/client/utils/log.js
ezii-os-1.0.0 node_modules/webpack-dev-server/client/utils/log.js
ezii-os-0.0.0.1.0 node_modules/webpack-dev-server/client/utils/log.js
ezii-os-0.0.0.0.1 node_modules/webpack-dev-server/client/utils/log.js