logger: make vararg
This commit is contained in:
parent
4208ca05db
commit
15d62ed301
1 changed files with 2 additions and 2 deletions
|
@ -56,7 +56,7 @@ const LEVEL_COLORS = {
|
|||
error: ["red", false],
|
||||
};
|
||||
|
||||
function baseLogger(prefix, level, message) {
|
||||
function baseLogger(prefix, level, ...message) {
|
||||
level = level || "info";
|
||||
|
||||
let out = "";
|
||||
|
@ -66,7 +66,7 @@ function baseLogger(prefix, level, message) {
|
|||
|
||||
out += `${color("magenta")}[${prefix}] ${color("default")}`;
|
||||
|
||||
out += message;
|
||||
out += [...message].map((m) => m.toString()).join(" ");
|
||||
|
||||
console.log(out);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue