logger: make vararg

This commit is contained in:
Cynthia Foxwell 2022-10-09 12:42:52 -06:00
parent 4208ca05db
commit 15d62ed301

View file

@ -56,7 +56,7 @@ const LEVEL_COLORS = {
error: ["red", false], error: ["red", false],
}; };
function baseLogger(prefix, level, message) { function baseLogger(prefix, level, ...message) {
level = level || "info"; level = level || "info";
let out = ""; let out = "";
@ -66,7 +66,7 @@ function baseLogger(prefix, level, message) {
out += `${color("magenta")}[${prefix}] ${color("default")}`; out += `${color("magenta")}[${prefix}] ${color("default")}`;
out += message; out += [...message].map((m) => m.toString()).join(" ");
console.log(out); console.log(out);
} }