Files
klz-cables.com/.pnpm-store/v10/files/85/2ecec08cd34cdd09464175131d2eb5207d975a868f9cd953bb626c820e0484219624e2c969326ebd68655ed669f58087b9ff3cf20e4b80c92838977455248a
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

46 lines
1.4 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugLogger = require('../utils/debug-logger.js');
const object = require('../utils/object.js');
const worldwide = require('../utils/worldwide.js');
const handlers = require('./handlers.js');
/**
* Add an instrumentation handler for when a console.xxx method is called.
*
* Use at your own risk, this might break without changelog notice, only used internally.
* @hidden
*/
function addConsoleInstrumentationHandler(handler) {
const type = 'console';
handlers.addHandler(type, handler);
handlers.maybeInstrument(type, instrumentConsole);
}
function instrumentConsole() {
if (!('console' in worldwide.GLOBAL_OBJ)) {
return;
}
debugLogger.CONSOLE_LEVELS.forEach(function (level) {
if (!(level in worldwide.GLOBAL_OBJ.console)) {
return;
}
object.fill(worldwide.GLOBAL_OBJ.console, level, function (originalConsoleMethod) {
debugLogger.originalConsoleMethods[level] = originalConsoleMethod;
return function (...args) {
const handlerData = { args, level };
handlers.triggerHandlers('console', handlerData);
const log = debugLogger.originalConsoleMethods[level];
log?.apply(worldwide.GLOBAL_OBJ.console, args);
};
});
});
}
exports.addConsoleInstrumentationHandler = addConsoleInstrumentationHandler;
//# sourceMappingURL=console.js.map