Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add none and warning to clientLogLevel #1901

Merged
merged 1 commit into from May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions client-src/default/index.js
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
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
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