Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
964 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var log = require('loglevel').getLogger('webpack-dev-server');
|
---|
4 |
|
---|
5 | var INFO = 'info';
|
---|
6 | var WARN = 'warn';
|
---|
7 | var ERROR = 'error';
|
---|
8 | var DEBUG = 'debug';
|
---|
9 | var TRACE = 'trace';
|
---|
10 | var SILENT = 'silent'; // deprecated
|
---|
11 | // TODO: remove these at major released
|
---|
12 | // https://github.com/webpack/webpack-dev-server/pull/1825
|
---|
13 |
|
---|
14 | var WARNING = 'warning';
|
---|
15 | var NONE = 'none'; // Set the default log level
|
---|
16 |
|
---|
17 | log.setDefaultLevel(INFO);
|
---|
18 |
|
---|
19 | function setLogLevel(level) {
|
---|
20 | switch (level) {
|
---|
21 | case INFO:
|
---|
22 | case WARN:
|
---|
23 | case ERROR:
|
---|
24 | case DEBUG:
|
---|
25 | case TRACE:
|
---|
26 | log.setLevel(level);
|
---|
27 | break;
|
---|
28 | // deprecated
|
---|
29 |
|
---|
30 | case WARNING:
|
---|
31 | // loglevel's warning name is different from webpack's
|
---|
32 | log.setLevel('warn');
|
---|
33 | break;
|
---|
34 | // deprecated
|
---|
35 |
|
---|
36 | case NONE:
|
---|
37 | case SILENT:
|
---|
38 | log.disableAll();
|
---|
39 | break;
|
---|
40 |
|
---|
41 | default:
|
---|
42 | log.error("[WDS] Unknown clientLogLevel '".concat(level, "'"));
|
---|
43 | }
|
---|
44 | }
|
---|
45 |
|
---|
46 | module.exports = {
|
---|
47 | log: log,
|
---|
48 | setLogLevel: setLogLevel
|
---|
49 | }; |
---|
Note:
See
TracBrowser
for help on using the repository browser.