diff --git a/package.json b/package.json index c084709..7f79364 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@navy.gif/logger", - "version": "2.3.2", + "version": "2.3.3", "description": "Logging thing", "author": "Navy.gif", "license": "MIT", diff --git a/src/MasterLogger.ts b/src/MasterLogger.ts index e5fcafe..c4dca37 100644 --- a/src/MasterLogger.ts +++ b/src/MasterLogger.ts @@ -168,14 +168,16 @@ class MasterLogger implements Logger { 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 ((broadcast || this.#_broadcastLevel <= this.#_logLevelMapping[type]) && this.#webhook) + if ((broadcast || this.#_broadcastLevel <= this.#_logLevelMapping[type]) && this.#webhook) { + const description = (subheader.length ? `**${subheader}**\n` : '') + `\`\`\`${text}\`\`\``; this.#webhook.send({ embeds: [{ title: `[__${type.toUpperCase()}__] ${this._shard(shard)}`, - description: `**${subheader}**\n\`\`\`${text}\`\`\``, + description, color: colour.int }] - }); + }); + } const streamType = this.#streamTypeMapping[type] || 'default'; if (this.#writeStreams[streamType])