diff --git a/src/MasterLogger.ts b/src/MasterLogger.ts index 252f365..9f3dba9 100644 --- a/src/MasterLogger.ts +++ b/src/MasterLogger.ts @@ -222,9 +222,14 @@ class MasterLogger implements Logger const maxChars = Math.max(...this.#types.map(t => t.length)); const spacer = ' '.repeat(maxChars - type.length); - if (this.#_logLevelMapping[type] >= this.#_logLevel) - console.log(`${colour.func(type)}${spacer} ${colour.func(header)}: ${chalk.bold(subheader)}${text}`); // eslint-disable-line no-console - + if (this.#_logLevelMapping[type] >= this.#_logLevel) + { + 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) { const description = (subheader.length ? `**${subheader}**\n` : '') + `\`\`\`${text}\`\`\``;