Fallback for when function name isn't in stack

This commit is contained in:
wearrrrr 2024-10-14 23:36:38 -05:00
parent 7bae982c2f
commit ca427c830c

View file

@ -15,8 +15,7 @@ export default {
fmt += `${stack[i].getFunctionName()} -> ` + fmt; fmt += `${stack[i].getFunctionName()} -> ` + fmt;
} }
} }
fmt += stack[0].getFunctionName() || "Anonymous";
fmt += stack[0].getFunctionName();
return fmt; return fmt;
}; };
@ -61,11 +60,7 @@ font-weight: bold;
font-family: monospace; font-family: monospace;
font-size: 0.9em; font-size: 0.9em;
`, `,
` `${severity === "debug" ? "color: gray" : ""}`, ...args);
${severity === "debug" ? "color: gray" : ""}
`,
...args
);
}, },
log: function (message: string, ...args: any[]) { log: function (message: string, ...args: any[]) {
this.fmt("log", message, ...args); this.fmt("log", message, ...args);