You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/api/logging.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,4 +37,22 @@ W> __Avoid noise in the log!__ Keep in mind that multiple plugins and loaders ar
37
37
-`logger.groupEnd()`: to end a logging group
38
38
-`logger.groupCollapsed(...)`: to group messages together. Displayed collapsed like `logger.log`. Displayed expanded when logging level is set to `'verbose'` or `'debug'`.
39
39
-`logger.clear()`: to print a horizontal line. Displayed like `logger.log`
40
-
-`logger.profile(...)`, `logger.profileEnd(...)`: to capture a profile. Delegated to `console.profile` when supported
40
+
-`logger.profile(...)`, `logger.profileEnd(...)`: to capture a profile. Delegated to `console.profile` when supported
41
+
42
+
## Runtime Logger API
43
+
44
+
Runtime logger API is only intended to be used as a development tool, it is not intended to be included in [production mode](/configuration/mode/#mode-production).
45
+
46
+
-`const logging = require('webpack/logging/runtime')`: to use the logger in runtime, require it directly from webpack
47
+
-`logging.getLogger('name')`: to get individual logger by name
48
+
-`logging.configureDefaultLogger(...)`: to override the default logger.
49
+
50
+
```javascript
51
+
constlogging=require('webpack/logging/runtime');
52
+
logging.configureDefaultLogger({
53
+
level:'log',
54
+
debug:/something/
55
+
});
56
+
```
57
+
58
+
-`logging.hooks.log`: to apply Plugins to the runtime logger
0 commit comments