decord/alpha/source/modules/debug/serializeAppStartLogs.tsx

253 lines
7.1 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 13141
// Function ID: 13142
// Name: serializeAppStartLogs
2026-10-12 06:59:38 +00:00
// Dependencies: [10, 12, 7923, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-13 12:43:34 +00:00
// Module 13141 (serializeAppStartLogs)
import _modDef12 from "module_12" /* 12 */;
2026-10-12 06:59:38 +00:00
import ThreadUtils from "ThreadUtils" /* 7923 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-10-03 08:58:59 +00:00
let item, prefix, set;
2026-07-20 16:05:17 +00:00
function getDisplayName(tag) {
2026-10-03 08:58:59 +00:00
let str3;
2026-07-20 16:05:17 +00:00
if (null == tag.tag) {
2026-10-03 08:58:59 +00:00
str3 = tag.label;
2026-07-20 16:05:17 +00:00
} else {
const _HermesInternal = HermesInternal;
str3 = "" + tag.label + " " + tag.tag;
}
let str4 = str3;
if (str3.includes("_START")) {
str4 = `Start ${str3.replace("_START", "")}`;
}
let text = str4;
if (str4.includes("_END")) {
text = `Finish ${str4.replace("_END", "")}`;
}
return text;
}
let result = size.fileFinishedImporting("modules/debug/serializeAppStartLogs.tsx");
2026-07-20 16:05:17 +00:00
export default function serializeAppStartLogs(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0 = arg0;
2026-07-29 08:29:29 +00:00
let flag = arg1;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
let flag2 = arg2;
if (arg2 === undefined) {
2026-07-20 16:05:17 +00:00
flag2 = true;
}
2026-07-23 10:11:24 +00:00
const logGroups = flag(flag2[0]).logGroups;
let mapped = logGroups.map((item) => {
2026-10-03 08:58:59 +00:00
let index;
let logs;
let nativeLogs;
let serverTrace;
let timestamp;
({ index, timestamp, logs, nativeLogs, serverTrace } = item);
2026-07-20 16:05:17 +00:00
let tmp = timestamp;
if (0 === index) {
2026-10-03 08:58:59 +00:00
const tmp2 = importDefault;
const tmp3 = dependencyMap;
let arr = _modDef12;
const found = arr.find(logs, (log) => {
2026-07-20 16:05:17 +00:00
log = log.log;
return log.indexOf("Logger loaded") >= 0;
});
2026-10-03 08:58:59 +00:00
let tmp5 = null;
let timestamp1;
2026-07-29 08:29:29 +00:00
if (found != null) {
timestamp1 = found.timestamp;
2026-07-20 16:05:17 +00:00
}
if (timestamp1 == null) {
timestamp1 = closure_0;
}
tmp = timestamp1;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
let closure_1 = flag;
let closure_2 = flag2;
2026-08-24 06:08:38 +00:00
const substr = logs.slice();
2026-10-03 08:58:59 +00:00
set = new Set(nativeLogs.map(getDisplayName));
let closure_4 = "";
let closure_5 = [];
item = nativeLogs.forEach((tag) => {
2026-10-03 08:58:59 +00:00
let str3;
let tmp13;
2026-07-29 08:29:29 +00:00
if (null == tag.tag) {
2026-10-03 08:58:59 +00:00
str3 = tag.label;
2026-07-29 08:29:29 +00:00
} else {
const _HermesInternal = HermesInternal;
str3 = "" + tag.label + " " + tag.tag;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let str4 = str3;
if (str3.includes("_START")) {
str4 = `Start ${str3.replace("_START", "")}`;
}
let str7 = str4;
if (str4.includes("_END")) {
str7 = `Finish ${str4.replace("_END", "")}`;
}
let tmp5 = tmp2;
let num = 0;
2026-10-03 08:58:59 +00:00
const startsWithResult = str7.startsWith("Start ") && !str7.includes("RUN_JS_BUNDLE") && set.has(str7.replace("Start ", "Finish "));
2026-07-29 08:29:29 +00:00
if (str7.startsWith("Finish ")) {
tmp5 = tmp2;
num = 0;
if (!str7.includes("RUN_JS_BUNDLE")) {
tmp5 = tmp2;
2026-07-20 16:05:17 +00:00
num = 0;
2026-07-29 08:29:29 +00:00
if (set.has(str7.replace("Finish ", "Start "))) {
prefix = prefix.substring(2);
const arr = closure_5.pop();
2026-07-29 08:29:29 +00:00
tmp5 = tmp2;
2026-07-20 16:05:17 +00:00
num = 0;
2026-07-29 08:29:29 +00:00
if (null != arr) {
const diff = tag.timestamp - arr.timestamp;
let tmp11 = tmp2;
2026-10-03 08:58:59 +00:00
if (!tmp11) {
2026-07-29 08:29:29 +00:00
let tmp12 = diff > 5;
if (tmp12) {
const items = ["GET_CONSTANTS", "CONVERT_CONSTANTS"];
tmp12 = !items.some((item) => str7.includes(item));
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp11 = tmp12;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
arr.shouldKeep = arr.shouldKeep || tmp11;
tmp5 = tmp11;
num = diff;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
const obj = { emoji: "\u2615", timestamp: tag.timestamp, delta: tmp13, prefix, log: str7, shouldKeep: tmp5 };
tmp13 = undefined;
2026-07-29 08:29:29 +00:00
if (num > 0) {
tmp13 = num;
}
let num4 = 0;
let num5 = 0;
2026-10-03 08:58:59 +00:00
if (0 < substr.length) {
2026-07-29 08:29:29 +00:00
while (true) {
let timestamp = arr2[num4].timestamp;
2026-07-29 08:29:29 +00:00
if (null == timestamp) {
num4 = num4 + 1;
num5 = num4;
if (num4 >= arr2.length) {
break;
}
} else {
num5 = num4;
if (timestamp > obj.timestamp) {
break;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
break;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
substr.splice(num5, 0, obj);
2026-07-29 08:29:29 +00:00
if (startsWithResult) {
prefix = `${closure_4}| `;
closure_5.push(obj);
2026-07-29 08:29:29 +00:00
}
});
2026-10-03 08:58:59 +00:00
let closure_6 = false;
2026-07-29 08:29:29 +00:00
const found1 = substr.filter((log) => {
2026-08-24 06:08:38 +00:00
let tmp = !closure_6;
if (closure_6) {
2026-07-29 08:29:29 +00:00
log = log.log;
tmp = !log.includes("\u21AA");
}
if (tmp) {
2026-08-24 06:08:38 +00:00
closure_6 = tmp3;
2026-07-29 08:29:29 +00:00
tmp = !tmp3;
}
return tmp;
});
timestamp1 = tmp;
2026-07-29 08:29:29 +00:00
let num2;
let num3;
let items = [];
let num = 0;
if (0 < found1.length) {
while (true) {
let tmp9 = found1[num];
let sum = num + 1;
let tmp11 = found1[sum];
let tmp12 = num;
if (null != tmp11) {
let str = tmp9.log;
if (tmp11.log === str.replace("Start ", "Finish ")) {
let str2 = tmp11.log;
tmp11.log = str2.replace("Finish ", "");
let arr2 = items.push(tmp11);
2026-07-29 08:29:29 +00:00
tmp12 = sum;
num = tmp12 + 1;
if (num >= found1.length) {
break;
}
2026-07-20 16:05:17 +00:00
}
}
let arr3 = items.push(tmp9);
2026-07-29 08:29:29 +00:00
}
}
const mapped = items.map((timestamp) => {
2026-10-03 08:58:59 +00:00
let str2;
let str3;
2026-07-29 08:29:29 +00:00
let str = "";
if (null != timestamp.timestamp) {
const result = (timestamp.timestamp - timestamp1) / 1000;
2026-07-29 08:29:29 +00:00
str = result.toFixed(3);
}
2026-10-03 08:58:59 +00:00
const obj = { totalTime: str, deltaTime: str2, log: "" + str3 + timestamp.prefix + timestamp.log + "\n" };
str2 = "";
2026-07-29 08:29:29 +00:00
if (null != timestamp.delta) {
const _String = String;
const _Math = Math;
str2 = String(Math.round(timestamp.delta));
}
2026-10-03 08:58:59 +00:00
str3 = "";
2026-07-29 08:29:29 +00:00
if (timestamp.emoji.length > 0) {
const _HermesInternal = HermesInternal;
str3 = "" + timestamp.emoji + " ";
}
return obj;
});
2026-10-03 08:58:59 +00:00
let obj = _modDef12;
num2 = obj.max(mapped.map((totalTime) => totalTime.totalTime.length));
2026-07-29 08:29:29 +00:00
if (num2 == null) {
num2 = 0;
}
2026-10-03 08:58:59 +00:00
let obj2 = _modDef12;
num3 = obj2.max(mapped.map((deltaTime) => deltaTime.deltaTime.length));
2026-07-29 08:29:29 +00:00
if (num3 == null) {
num3 = 0;
}
const mapped1 = mapped.map((item) => {
2026-10-03 08:58:59 +00:00
let deltaTime;
let log;
let totalTime;
({ totalTime, deltaTime, log } = item);
const obj = flag(flag2[1]);
2026-10-03 08:58:59 +00:00
const padStartResult = obj.padStart(totalTime, num2);
const obj2 = flag(flag2[1]);
return "" + padStartResult + " " + obj2.padStart(deltaTime, num3) + " " + log;
2026-07-29 08:29:29 +00:00
});
const sum1 = index + 1;
const joined = mapped1.join("");
2026-10-03 08:58:59 +00:00
const obj4 = ThreadUtils;
const combined = "Trace #" + sum1 + " started " + obj4.getTimestampString(timestamp) + "\n" + joined;
2026-07-29 08:29:29 +00:00
let sum2 = combined;
2026-07-20 16:05:17 +00:00
if (null != serverTrace) {
2026-07-23 10:11:24 +00:00
let _HermesInternal = HermesInternal;
2026-10-03 08:58:59 +00:00
let str3 = "\n Server trace for trace #";
2026-07-29 08:29:29 +00:00
sum2 = combined + "\n Server trace for trace #" + index + 1 + serverTrace;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return sum2;
2026-07-20 16:05:17 +00:00
});
return mapped.join("\n\n");
};