106 lines
2.7 KiB
JavaScript
106 lines
2.7 KiB
JavaScript
// Metro module 954 (f955).
|
|
import * as _objectWithoutProperties from "./_objectWithoutProperties";
|
|
import { getClient } from "./Module848";
|
|
import { formatConsoleArgs } from "./Module952";
|
|
import { _INTERNAL_captureLog } from "./Module880";
|
|
const _excluded = ["type", "level", "message", "args", "tag", "date"];
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
const _excluded2 = ["trace", "debug", "info", "warn", "error", "fatal"];
|
|
let c788_5 = {
|
|
silent: "trace",
|
|
fatal: "fatal",
|
|
error: "error",
|
|
warn: "warn",
|
|
log: "info",
|
|
info: "info",
|
|
success: "info",
|
|
fail: "error",
|
|
ready: "info",
|
|
start: "info",
|
|
box: "info",
|
|
debug: "debug",
|
|
trace: "trace",
|
|
verbose: "debug",
|
|
critical: "fatal",
|
|
notice: "info"
|
|
};
|
|
let c788_6 = {
|
|
0: "fatal",
|
|
1: "warn",
|
|
2: "info",
|
|
3: "info",
|
|
4: "debug",
|
|
5: "trace"
|
|
};
|
|
export function createConsolaReporter(r1 = {}) {
|
|
const r5 = Set;
|
|
let levels = r1.levels;
|
|
if (levels == null) {
|
|
levels = _excluded2;
|
|
}
|
|
let c12595_0 = new r5(levels);
|
|
const client = r1.client;
|
|
return {
|
|
log: (a0) => {
|
|
let level2;
|
|
const { type, level, message, args, tag } = a0;
|
|
a0.date;
|
|
const rest = _objectWithoutProperties(a0, _excluded);
|
|
let r19 = client;
|
|
if (!client) {
|
|
r19 = getClient();
|
|
}
|
|
if (r19) {
|
|
L10: {
|
|
level2 = "debug";
|
|
if (type !== "verbose") {
|
|
level2 = "trace";
|
|
if (type !== "silent") {
|
|
if (type) {
|
|
level2 = c788_5[type];
|
|
if (level2) {
|
|
break L10;
|
|
}
|
|
}
|
|
level2 = "info";
|
|
if (typeof level === "number") {
|
|
const r29 = c788_6[level];
|
|
level2 = r29 ? r29 : "info";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (c12595_0.has(level2)) {
|
|
const options = r19.getOptions();
|
|
const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;
|
|
const r38 = [];
|
|
if (message) {
|
|
r38.push(message);
|
|
}
|
|
if (args && args.length > 0) {
|
|
r38.push(formatConsoleArgs(args, normalizeDepth, normalizeMaxBreadth));
|
|
}
|
|
const message2 = r38.join(" ");
|
|
rest["sentry.origin"] = "auto.log.consola";
|
|
if (tag) {
|
|
rest["consola.tag"] = tag;
|
|
}
|
|
if (type) {
|
|
rest["consola.type"] = type;
|
|
}
|
|
if (level != null && typeof level === "number") {
|
|
rest["consola.level"] = level;
|
|
}
|
|
_INTERNAL_captureLog({
|
|
level: level2,
|
|
message: message2,
|
|
attributes: rest
|
|
});
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|