decord/source/904_addConsoleBreadcrumb.js

74 lines
2.4 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 904
2026-07-25 08:10:48 +00:00
// Function ID: 9950
2026-07-20 16:05:17 +00:00
// Name: addConsoleBreadcrumb
2026-07-23 10:11:24 +00:00
// Dependencies: [65, 863, 801, 895, 825, 896, 884, 798, 809]
2026-07-20 16:05:17 +00:00
// Module 904 (addConsoleBreadcrumb)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray";
import setupIntegration from "setupIntegration";
2026-07-20 16:05:17 +00:00
function addConsoleBreadcrumb(level, arguments) {
2026-07-23 10:11:24 +00:00
obj = { category: "console", data: obj };
obj = { arguments, logger: "console", level: require(896) /* severityLevelFromString */.severityLevelFromString(level), message: formatConsoleArgs(arguments) };
2026-07-20 16:05:17 +00:00
if ("assert" === level) {
if (false === arguments[0]) {
const substr = arguments.slice(1);
let str2 = "Assertion failed";
if (substr.length > 0) {
const _HermesInternal = HermesInternal;
str2 = "Assertion failed: " + formatConsoleArgs(substr);
}
obj.message = str2;
obj.data.arguments = substr;
}
}
2026-07-23 10:11:24 +00:00
const obj3 = require(896) /* severityLevelFromString */;
2026-07-20 16:05:17 +00:00
obj = { input: arguments, level };
2026-07-23 10:11:24 +00:00
require(884) /* addBreadcrumb */.addBreadcrumb(obj, obj);
2026-07-20 16:05:17 +00:00
}
function formatConsoleArgs(arg0) {
2026-07-23 10:11:24 +00:00
if ("util" in require(798).GLOBAL_OBJ) {
if ("function" === typeof require(798).GLOBAL_OBJ.util.format) {
const util = require(798).GLOBAL_OBJ.util;
2026-07-20 16:05:17 +00:00
const format = util.format;
2026-07-23 10:11:24 +00:00
let applyResult = format.apply(util, _toConsumableArray(arg0));
2026-07-20 16:05:17 +00:00
}
return applyResult;
}
2026-07-23 10:11:24 +00:00
applyResult = require(809) /* isMatchingPattern */.safeJoin(arg0, " ");
2026-07-20 16:05:17 +00:00
}
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
export { addConsoleBreadcrumb };
2026-07-23 10:11:24 +00:00
export const consoleIntegration = setupIntegration.defineIntegration(() => {
2026-07-20 16:05:17 +00:00
let _Set = Set;
if (arguments.length > 0) {
if (undefined !== arguments[0]) {
const first = arguments[0];
}
let CONSOLE_LEVELS = {}.levels;
if (!CONSOLE_LEVELS) {
2026-07-23 10:11:24 +00:00
CONSOLE_LEVELS = _Set(801).CONSOLE_LEVELS;
2026-07-20 16:05:17 +00:00
}
const prototype = _Set.prototype;
_Set = new _Set(CONSOLE_LEVELS);
const obj = {
name: "Console",
setup(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
const result = _Set(outer1_1[3]).addConsoleInstrumentationHandler((level) => {
2026-07-20 16:05:17 +00:00
level = level.level;
2026-07-23 10:11:24 +00:00
let hasItem = _Set(outer2_1[4]).getClient() === set;
2026-07-20 16:05:17 +00:00
if (hasItem) {
2026-07-23 10:11:24 +00:00
hasItem = set.has(level);
2026-07-20 16:05:17 +00:00
}
if (hasItem) {
2026-07-23 10:11:24 +00:00
outer2_3(level, level.args);
2026-07-20 16:05:17 +00:00
}
});
}
};
return obj;
}
});