Skip to content

Commit

Permalink
fix: add none and warning to clientLogLevel
Browse files Browse the repository at this point in the history
fixes: #1899
ref: #1825
  • Loading branch information
hiroppy committed May 17, 2019
1 parent 45d39ac commit becb15b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
13 changes: 13 additions & 0 deletions client-src/default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const DEBUG = 'debug';
const TRACE = 'trace';
const SILENT = 'silent';

// deprecated
// TODO: remove these at major released
// https://github.com/webpack/webpack-dev-server/pull/1825
const WARNING = 'warning';
const NONE = 'none';

// Set the default log level
log.setDefaultLevel(INFO);

Expand Down Expand Up @@ -121,6 +127,13 @@ const onSocketMsg = {
case ERROR:
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;
Expand Down
11 changes: 10 additions & 1 deletion lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@
]
},
"clientLogLevel": {
"enum": ["info", "warn", "error", "debug", "trace", "silent"]
"enum": [
"info",
"warn",
"error",
"debug",
"trace",
"silent",
"none",
"warning"
]
},
"compress": {
"type": "boolean"
Expand Down
15 changes: 13 additions & 2 deletions test/options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,19 @@ describe('options', () => {
failure: [false],
},
clientLogLevel: {
success: ['silent', 'info', 'error', 'warn', 'trace', 'debug'],
failure: ['whoops!', 'none', 'warning'],
success: [
'silent',
'info',
'error',
'warn',
'trace',
'debug',
// deprecated
'none',
// deprecated
'warning',
],
failure: ['whoops!'],
},
compress: {
success: [true],
Expand Down

0 comments on commit becb15b

Please sign in to comment.