actually use error stream for errors

This commit is contained in:
Erik 2023-08-11 22:02:43 +03:00
parent 40f6bc572e
commit 127bc40ba6
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68

View File

@ -222,9 +222,14 @@ class MasterLogger implements Logger
const maxChars = Math.max(...this.#types.map(t => t.length)); const maxChars = Math.max(...this.#types.map(t => t.length));
const spacer = ' '.repeat(maxChars - type.length); const spacer = ' '.repeat(maxChars - type.length);
if (this.#_logLevelMapping[type] >= this.#_logLevel) if (this.#_logLevelMapping[type] >= this.#_logLevel)
console.log(`${colour.func(type)}${spacer} ${colour.func(header)}: ${chalk.bold(subheader)}${text}`); // eslint-disable-line no-console {
const out = `${colour.func(type)}${spacer} ${colour.func(header)}: ${chalk.bold(subheader)}${text}`;
if (type === 'error')
console.error(out); // eslint-disable-line no-console
else
console.log(out); // eslint-disable-line no-console
}
if ((broadcast || this.#_broadcastLevel <= this.#_logLevelMapping[type]) && this.#webhook) if ((broadcast || this.#_broadcastLevel <= this.#_logLevelMapping[type]) && this.#webhook)
{ {
const description = (subheader.length ? `**${subheader}**\n` : '') + `\`\`\`${text}\`\`\``; const description = (subheader.length ? `**${subheader}**\n` : '') + `\`\`\`${text}\`\`\``;