Files
discord-decomp/_bundle/Module861.js
T
2026-11-01 12:12:55 +02:00

45 lines
1.5 KiB
JavaScript

// Metro module 861 (f862).
import { DEBUG_BUILD } from "./Module823";
import { spanToJSON, getRootSpan, spanIsSampled } from "./spanToJSON";
import { debug } from "./consoleSandbox";
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
export function logSpanEnd(a0) {
if (DEBUG_BUILD) {
const r25 = spanToJSON(a0);
const { description = "< unknown name >", op = "< unknown op >" } = r25;
const spanId = a0.spanContext().spanId;
debug.log(`[Tracing] Finishing "${op}" ${getRootSpan(a0) === a0 ? "root " : ""}span "${description}" with ID ${spanId}`);
}
}
export function logSpanStart(a0) {
if (DEBUG_BUILD) {
const r27 = spanToJSON(a0);
const { description = "< unknown name >", op = "< unknown op >", parent_span_id } = r27;
const spanId = a0.spanContext().spanId;
const r35 = spanIsSampled(a0);
const rootSpan = getRootSpan(a0);
const r16 = r35 ? "sampled" : "unsampled";
const r1 = rootSpan === a0;
const r40 = `[Tracing] Starting ${r16} ${r1 ? "root " : ""}span`;
const r45 = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`];
if (parent_span_id) {
r45.push(`parent ID: ${parent_span_id}`);
}
if (!r1) {
const r63 = spanToJSON(rootSpan);
const { op: op2, description: description2 } = r63;
r45.push(`root ID: ${rootSpan.spanContext().spanId}`);
if (op2) {
r45.push(`root op: ${op2}`);
}
if (description2) {
r45.push(`root description: ${description2}`);
}
}
debug.log(`${r40}
${r45.join("\n ")}`);
}
}