Cleanup long debug output

This commit is contained in:
daydreamer-json
2026-01-22 19:05:16 +09:00
parent b9c2d4253a
commit 65e0b0fe2e
8 changed files with 43 additions and 42 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
config
# dependencies (bun install) # dependencies (bun install)
node_modules node_modules

View File

@@ -18,4 +18,4 @@
"description": "" "description": ""
} }
} }
] ]

View File

@@ -15,4 +15,4 @@
"total_size": "360836427", "total_size": "360836427",
"description": "" "description": ""
} }
} }

View File

@@ -15,4 +15,4 @@
"total_size": "360836427", "total_size": "360836427",
"description": "" "description": ""
} }
} }

View File

@@ -18,4 +18,4 @@
"description": "" "description": ""
} }
} }
] ]

View File

@@ -15,4 +15,4 @@
"total_size": "360836427", "total_size": "360836427",
"description": "" "description": ""
} }
} }

View File

@@ -15,4 +15,4 @@
"total_size": "360836427", "total_size": "360836427",
"description": "" "description": ""
} }
} }

View File

@@ -5,48 +5,29 @@ import apiUtils from '../utils/api.js';
import argvUtils from '../utils/argv.js'; import argvUtils from '../utils/argv.js';
import appConfig from '../utils/config.js'; import appConfig from '../utils/config.js';
import logger from '../utils/logger.js'; import logger from '../utils/logger.js';
import mathUtils from '../utils/math.js';
async function mainCmdHandler() { async function mainCmdHandler() {
const cfg = appConfig.network.api.akEndfield; const cfg = appConfig.network.api.akEndfield;
await (async () => { // await (async () => {
const channel = appConfig.network.api.akEndfield.channel.osWinRel; // const channel = appConfig.network.api.akEndfield.channel.osWinRel;
logger.debug('apiAkEndfield.launcher.latestGame fetching ...'); // logger.debug('apiAkEndfield.launcher.web fetching ...');
console.log( // for (const fn of [
await apiUtils.apiAkEndfield.launcher.latestGame( // apiUtils.apiAkEndfield.launcher.web.sidebar,
appConfig.network.api.akEndfield.appCode.osWinRel, // apiUtils.apiAkEndfield.launcher.web.singleEnt,
appConfig.network.api.akEndfield.launcherAppCode.osWinRel, // apiUtils.apiAkEndfield.launcher.web.mainBgImage,
channel, // apiUtils.apiAkEndfield.launcher.web.banner,
channel, // apiUtils.apiAkEndfield.launcher.web.announcement,
channel, // ]) {
null, // console.dir(await fn(appConfig.network.api.akEndfield.appCode.osWinRel, channel, channel, 'ja-jp'), {
), // depth: null,
); // });
logger.debug('apiAkEndfield.launcher.latestLauncher fetching ...'); // }
console.log( // })();
await apiUtils.apiAkEndfield.launcher.latestLauncher(
appConfig.network.api.akEndfield.launcherAppCode.osWinRel,
channel,
channel,
null,
null,
),
);
logger.debug('apiAkEndfield.launcher.web fetching ...');
for (const fn of [
apiUtils.apiAkEndfield.launcher.web.sidebar,
apiUtils.apiAkEndfield.launcher.web.singleEnt,
apiUtils.apiAkEndfield.launcher.web.mainBgImage,
apiUtils.apiAkEndfield.launcher.web.banner,
apiUtils.apiAkEndfield.launcher.web.announcement,
]) {
console.dir(await fn(appConfig.network.api.akEndfield.appCode.osWinRel, channel, channel, 'ja-jp'), {
depth: null,
});
}
})();
await (async () => { await (async () => {
logger.debug('Fetching latestGame ...');
const rsp = await apiUtils.apiAkEndfield.launcher.latestGame( const rsp = await apiUtils.apiAkEndfield.launcher.latestGame(
cfg.appCode.osWinRel, cfg.appCode.osWinRel,
cfg.launcherAppCode.osWinRel, cfg.launcherAppCode.osWinRel,
@@ -55,6 +36,19 @@ async function mainCmdHandler() {
cfg.channel.osWinRel, cfg.channel.osWinRel,
null, null,
); );
logger.info(
`Fetched latestGame: v${rsp.version}, ${mathUtils.formatFileSize(
parseInt(rsp.pkg.total_size) - mathUtils.arrayTotal(rsp.pkg.packs.map((e) => parseInt(e.package_size))),
{
decimals: 2,
decimalPadding: true,
useBinaryUnit: true,
useBitUnit: false,
unitVisible: true,
unit: null,
},
)}`,
);
const prettyRsp = { const prettyRsp = {
req: { req: {
appCode: cfg.appCode.osWinRel, appCode: cfg.appCode.osWinRel,
@@ -98,6 +92,8 @@ async function mainCmdHandler() {
})(); })();
await (async () => { await (async () => {
logger.debug('Fetching latestGameRes ...');
const versionInfoList = ( const versionInfoList = (
( (
await Bun.file( await Bun.file(
@@ -134,6 +130,7 @@ async function mainCmdHandler() {
versionInfoEntry.version, versionInfoEntry.version,
versionInfoEntry.randStr, versionInfoEntry.randStr,
); );
logger.info(`Fetched latestGameRes: v${versionInfoEntry.version}, ${rsp.res_version}`);
const prettyRsp = { const prettyRsp = {
req: { req: {
appCode: cfg.appCode.osWinRel, appCode: cfg.appCode.osWinRel,
@@ -177,6 +174,7 @@ async function mainCmdHandler() {
})(); })();
await (async () => { await (async () => {
logger.debug('Fetching latestLauncher ...');
const launcherTargetAppList = ['EndField', 'official'] as const; const launcherTargetAppList = ['EndField', 'official'] as const;
for (const launcherTargetAppEntry of launcherTargetAppList) { for (const launcherTargetAppEntry of launcherTargetAppList) {
const rsp = await apiUtils.apiAkEndfield.launcher.latestLauncher( const rsp = await apiUtils.apiAkEndfield.launcher.latestLauncher(
@@ -186,6 +184,7 @@ async function mainCmdHandler() {
null, null,
launcherTargetAppEntry === 'official' ? null : launcherTargetAppEntry, launcherTargetAppEntry === 'official' ? null : launcherTargetAppEntry,
); );
logger.info(`Fetched latestLauncher: v${rsp.version}, ${launcherTargetAppEntry}`);
const prettyRsp = { const prettyRsp = {
req: { req: {
appCode: cfg.launcherAppCode.osWinRel, appCode: cfg.launcherAppCode.osWinRel,