Skip to content

Commit

Permalink
fix: add none and warning to clientLogLevel (#1901)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy authored and evilebottnawi committed May 17, 2019
1 parent 45d39ac commit 0ae9be8
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 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
2 changes: 1 addition & 1 deletion test/__snapshots__/Routes.test.js.snap

Large diffs are not rendered by default.

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 0ae9be8

Please sign in to comment.