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

Function createLogger

test/TestCases.template.js:57–81  ·  view source on GitHub ↗
(appendTarget, appendErrors)

Source from the content-addressed store, hash-verified

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