From c3f005073452344d8d527b7b1ec8ff0117f34453 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 13 Nov 2023 14:21:43 +0200 Subject: [PATCH] Send env in footer --- .eslintrc.json | 1 + src/MasterLogger.ts | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 17040c2..02a5017 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -145,6 +145,7 @@ "no-buffer-constructor": "warn", "no-caller": "warn", "no-console": "warn", + "no-constant-binary-expression": "error", "no-div-regex": "warn", "no-dupe-else-if": "warn", "no-duplicate-imports": "warn", diff --git a/src/MasterLogger.ts b/src/MasterLogger.ts index a412560..ff967a5 100644 --- a/src/MasterLogger.ts +++ b/src/MasterLogger.ts @@ -229,14 +229,17 @@ class MasterLogger implements Logger 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}\`\`\``; this.#webhook.send({ embeds: [{ title: `[__${type.toUpperCase()}__] ${this._shard(shard)}`, description, - color: colour.int + color: colour.int, + footer: { + text: `ENV: ${process.env.NODE_ENV ?? 'production'}` + } }] }); }