1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 21:00:23 +01:00

Secured logging color picking

This commit is contained in:
kkapsner 2017-12-18 23:57:25 +01:00
parent 04d3777e6f
commit 18ceb998e0

View File

@ -59,10 +59,10 @@
"]"; "]";
if (typeof args[0] === "string"){ if (typeof args[0] === "string"){
args[0] = pre + " " + args[0]; args[0] = pre + " " + args[0];
args.splice(1, 0, colors[level]); args.splice(1, 0, colors[level] || "");
} }
else { else {
args.unshift(colors[level]); args.unshift(colors[level] || "");
args.unshift(pre); args.unshift(pre);
} }
console.log.apply(console, args); console.log.apply(console, args);