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

Function createLogger

test/ConfigTestCases.template.js:52–76  ·  test/ConfigTestCases.template.js::createLogger
(appendTarget, appendErrors)

Source from the content-addressed store, hash-verified

50 * @returns {EXPECTED_ANY} logger object
51 */
52const createLogger = (appendTarget, appendErrors) => ({
53 log: (/** @type {string} */ l) => appendTarget.push(l),
54 debug: (/** @type {string} */ l) => appendTarget.push(l),
55 trace: (/** @type {string} */ l) => appendTarget.push(l),
56 info: (/** @type {string} */ l) => appendTarget.push(l),
57 class="cm">// Collect warn/error separately: every infrastructure warning/error must be
58 class="cm">// declared in the case's infrastructure-log.js or the test fails, so a cache
59 class="cm">// store/restore failure can't slip through unnoticed.
60 warn: (/** @type {string} */ l, /** @type {EXPECTED_ANY[]} */ ...args) => {
61 appendErrors.push(l);
62 console.warn(l, ...args);
63 },
64 error: (/** @type {string} */ l, /** @type {EXPECTED_ANY[]} */ ...args) => {
65 appendErrors.push(l);
66 console.error(l, ...args);
67 },
68 logTime: () => {},
69 group: () => {},
70 groupCollapsed: () => {},
71 groupEnd: () => {},
72 profile: () => {},
73 profileEnd: () => {},
74 clear: () => {},
75 status: () => {}
76});
77
78/**
79 * @param {SuiteConfig} config suite config

Callers 1

describeCasesFunction · 0.70

Calls 3

warnMethod · 0.80
pushMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected