mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-04-27 07:35:07 +00:00
init
This commit is contained in:
45
node_modules/@sentry/utils/cjs/instrument/console.js
generated
vendored
Normal file
45
node_modules/@sentry/utils/cjs/instrument/console.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const logger = require('../logger.js');
|
||||
const object = require('../object.js');
|
||||
const worldwide = require('../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;
|
||||
}
|
||||
|
||||
logger.CONSOLE_LEVELS.forEach(function (level) {
|
||||
if (!(level in worldwide.GLOBAL_OBJ.console)) {
|
||||
return;
|
||||
}
|
||||
|
||||
object.fill(worldwide.GLOBAL_OBJ.console, level, function (originalConsoleMethod) {
|
||||
logger.originalConsoleMethods[level] = originalConsoleMethod;
|
||||
|
||||
return function (...args) {
|
||||
const handlerData = { args, level };
|
||||
_handlers.triggerHandlers('console', handlerData);
|
||||
|
||||
const log = logger.originalConsoleMethods[level];
|
||||
log && log.apply(worldwide.GLOBAL_OBJ.console, args);
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
exports.addConsoleInstrumentationHandler = addConsoleInstrumentationHandler;
|
||||
//# sourceMappingURL=console.js.map
|
||||
Reference in New Issue
Block a user