diff --git a/src/html/log.ts b/src/html/log.ts
index 0f40f00..e06957f 100644
--- a/src/html/log.ts
+++ b/src/html/log.ts
@@ -97,46 +97,47 @@ export default /*html*/ `
}
if(Array.isArray(json)){
- addSpaces(depth, "[");
-
+ addSpaces(0, "[");
+ let doBreak = JSON.stringify(json).length > 64;
json.forEach((e,i) => {
- if(i == 0) addBreak();
- addSpaces(depth+2);
+ if(i == 0 && doBreak) addBreak();
+ if(doBreak) addSpaces(depth+2);
addData(e);
if(i+1 < json.length){
let k = document.createElement("span");
- k.innerText = ",";
+ k.innerText = ", ";
elems.push(k);
}
- addBreak();
+ if(doBreak) addBreak();
});
- addSpaces(depth, "]");
+ addSpaces(doBreak ? depth : 0, "]");
}else{
- addSpaces(depth, "{");
+ addSpaces(0, "{");
let keys = Object.keys(json);
+ let doBreak = JSON.stringify(json).length > 64;
for(let i = 0; i < keys.length; i++){
- if(i == 0) addBreak();
+ if(i == 0 && doBreak) addBreak();
let key = keys[i];
- addSpaces(depth+2);
+ if(doBreak) addSpaces(depth+2);
let keyElem = document.createElement("span");
keyElem.innerText = key + ": ";
elems.push(keyElem);
addData(json[key]);
- if(i+1 < json.length){
+ if(i+1 < keys.length){
let k = document.createElement("span");
- k.innerText = ",";
+ k.innerText = ", ";
elems.push(k);
}
- addBreak();
+ if(doBreak) addBreak();
}
- addSpaces(depth, "}");
+ addSpaces(doBreak ? depth : 0, "}");
}
return elems;
}
diff --git a/src/sys/log.ts b/src/sys/log.ts
index 2838410..3be1d6d 100644
--- a/src/sys/log.ts
+++ b/src/sys/log.ts
@@ -62,7 +62,7 @@ let clearLogID = setInterval(() => {
if (global.provideLog >= -1)
logList.splice(0, logList.length - global.provideLog)
}, 60000);
-addShutdownTask(()=>clearInterval(clearLogID));
+addShutdownTask(() => clearInterval(clearLogID));
const consorArgs = (args: any[]) => {
let out = [];
@@ -74,7 +74,7 @@ const consorArgs = (args: any[]) => {
}
const censorLogArg = (arg: any) => {
if (typeof arg != "object" || arg == null || arg instanceof Error) return arg;
- let out: any = {};
+ let out: any = Array.isArray(arg) ? [] : {};
for (let key in arg) {
if ((["accountKey", "sign", "publicKey", "token"]).includes(key)) out[key] = new Array(Math.min(arg[key].length, 50)).fill("*").join("");
else out[key] = censorLogArg(arg[key]);