70 lines
2.0 KiB
JavaScript
70 lines
2.0 KiB
JavaScript
// Metro module 928 (f929).
|
|
import { defineIntegration } from "./setupIntegration";
|
|
import { CONSOLE_LEVELS } from "./consoleSandbox";
|
|
import { addConsoleInstrumentationHandler } from "./instrumentConsole";
|
|
import { getClient } from "./Module848";
|
|
import { severityLevelFromString } from "./Module920";
|
|
import { addBreadcrumb } from "./Module908";
|
|
import { GLOBAL_OBJ } from "./Module821";
|
|
import { safeJoin } from "./Module832";
|
|
const addConsoleBreadcrumb = function addConsoleBreadcrumb(a0, args) {
|
|
let r64, message;
|
|
const r6 = {
|
|
category: "console",
|
|
data: {
|
|
arguments: args,
|
|
logger: "console"
|
|
},
|
|
level: severityLevelFromString(a0),
|
|
message: null
|
|
};
|
|
if ("util" in GLOBAL_OBJ && typeof GLOBAL_OBJ.util.format === "function") {
|
|
const util = GLOBAL_OBJ.util;
|
|
message = util.format.apply(util, [...args]);
|
|
} else {
|
|
message = safeJoin(args, " ");
|
|
}
|
|
r6.message = message;
|
|
if (a0 === "assert") {
|
|
if (args[0] !== false) {
|
|
return void 0;
|
|
}
|
|
const arguments2 = args.slice(1);
|
|
const r49 = arguments2.length > 0;
|
|
let message2 = "Assertion failed";
|
|
if (r49) {
|
|
if ("util" in GLOBAL_OBJ && typeof GLOBAL_OBJ.util.format === "function") {
|
|
const util2 = GLOBAL_OBJ.util;
|
|
r64 = util2.format.apply(util2, [...arguments2]);
|
|
} else {
|
|
r64 = safeJoin(arguments2, " ");
|
|
}
|
|
message2 = `Assertion failed: ${r64}`;
|
|
}
|
|
r6.message = message2;
|
|
r6.data.arguments = arguments2;
|
|
}
|
|
addBreadcrumb(r6, {
|
|
input: args,
|
|
level: a0
|
|
});
|
|
};
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
const r17 = defineIntegration(function(r1 = {}) {
|
|
let c12573_0 = new Set(r1.levels || CONSOLE_LEVELS);
|
|
return {
|
|
name: "Console",
|
|
setup: (c23908_0) => {
|
|
addConsoleInstrumentationHandler(({ args, level }) => {
|
|
if (getClient() === c23908_0 && c12573_0.has(level)) {
|
|
addConsoleBreadcrumb(level, args);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
});
|
|
export { addConsoleBreadcrumb };
|
|
export { r17 as consoleIntegration };
|