MCPcopy
hub / github.com/webpack/webpack / createLogger

Function createLogger

test/Examples.test.js:18–42  ·  view source on GitHub ↗
(appendErrors)

Source from the content-addressed store, hash-verified

16 * @returns {EXPECTED_ANY} logger object
17 */
18const createLogger = (appendErrors) => ({
19 log: () => {},
20 debug: () => {},
21 trace: () => {},
22 info: () => {},
23 // Every infrastructure warning/error must be declared in the example's
24 // infrastructure-log.js or the build fails, so a filesystem-cache
25 // store/restore failure can't slip through unnoticed.
26 warn: (/** @type {string} */ l, /** @type {EXPECTED_ANY[]} */ ...args) => {
27 appendErrors.push(l);
28 console.warn(l, ...args);
29 },
30 error: (/** @type {string} */ l, /** @type {EXPECTED_ANY[]} */ ...args) => {
31 appendErrors.push(l);
32 console.error(l, ...args);
33 },
34 logTime: () => {},
35 group: () => {},
36 groupCollapsed: () => {},
37 groupEnd: () => {},
38 profile: () => {},
39 profileEnd: () => {},
40 clear: () => {},
41 status: () => {}
42});
43
44const nodeVersion = Number.parseInt(process.version.slice(1).split(".")[0], 10);
45// eslint-disable-next-line no-new-func

Callers 1

processOptionsFunction · 0.70

Calls 3

warnMethod · 0.80
pushMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected