From cc3d394b3d58eb8c9356bd67cbbae87fdffe0e1b Mon Sep 17 00:00:00 2001 From: powermaker450 Date: Fri, 26 Jul 2024 01:45:57 -0400 Subject: [PATCH] Fix minor Logger things --- src/bot.ts | 6 +++--- src/utils/logger.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bot.ts b/src/bot.ts index 98b31b3..7b9f6f5 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -60,7 +60,7 @@ client.connect().then(async () => { const SELF = await client.whoami().then((response) => { return response.userId; }); - logger.log("Our userId is:", SELF); + logger.log("Our userId is:", emp(SELF)); logger.log("Messages from this userId are automatically ignored."); client.onMessage(async (message) => { @@ -86,7 +86,7 @@ client.connect().then(async () => { .replace("Please generate: ", "") .replace("please generate: ", "") .replace("without", "|"); - logger.log("Generating image:", prompt); + logger.log("Generating image:", emp(prompt)); await client.sendMessage({ converseId: message.converseId, @@ -115,7 +115,7 @@ client.connect().then(async () => { .replace(/(\[(.*?)\])/g, "") .replace("{BACKEND}", HOST); const username = await getUsername(HOST, message.author!); - logger.log("Analyzing the image at:", imageData); + logger.log("Analyzing the image at:", emp(imageData)); await client.sendMessage({ converseId: message.converseId, diff --git a/src/utils/logger.ts b/src/utils/logger.ts index aeb40e4..4d4247d 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,4 +1,4 @@ -import chalk, { ChalkFunction } from "chalk"; +import chalk from "chalk"; export class Logger { private _wrn: string; @@ -13,15 +13,15 @@ export class Logger { } log(text: any, args?: any): void { - console.log(this._main + text, args); + args ? console.log(this._main + text, args) : console.log(this._main + text); } warn(text: any, args?: any): void { - console.warn(this._wrn + this._main + text, args); + args ? console.warn(this._wrn + this._main + text, args) : console.warn(this._wrn + this._main + text); } error(text: any, args?: any): void { - console.error(this._err + this._main + text, args); + args ? console.error(this._err + this._main + text, args) : console.error(this._err + this._main + text); } }