Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
marceldobehere committed Aug 18, 2024
1 parent 5c7506b commit effdc71
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions client/js/goofyConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,23 @@ function createFakeConsoleEntry(level, args, add) {
for (let i = 0; i < args.length; i++) {
if (i > 0)
msg += " ";

let argStr = JSON.stringify(args[i]);
if (argStr === undefined)
argStr = "undefined";
else if (argStr === null)
argStr = "null";

if (argStr.startsWith("\"") && argStr.endsWith("\""))
argStr = argStr.substring(1, argStr.length - 1);

if (argStr.length > 150) // get first 100, then ... then last 5
argStr = argStr.substring(0, 150) + " [...] " + argStr.substring(argStr.length - 5);
if (argStr.length > 100) // get first 100, then ... then last 5
{
argStr = argStr.substring(0, 100) + " [...] " + argStr.substring(argStr.length - 5);
spanMsg.onclick = function () {
alert(JSON.stringify(args[i], null, 2));
};
}
msg += argStr;
}

Expand Down

0 comments on commit effdc71

Please sign in to comment.