diff --git a/.dev.env b/.dev.env index b61d698..c02e9db 100644 --- a/.dev.env +++ b/.dev.env @@ -12,6 +12,7 @@ BOT_AUTHOR=Vylpes BOT_OWNERID=147392775707426816 BOT_CLIENTID=682942374040961060 BOT_ENV=4 +BOT_VERBOSE=false BOT_ADMINS=147392775707426816,887272961504071690 ABOUT_FUNDING= diff --git a/.prod.env b/.prod.env index a3d5a1e..b2e9e61 100644 --- a/.prod.env +++ b/.prod.env @@ -12,6 +12,7 @@ BOT_AUTHOR=Vylpes BOT_OWNERID=147392775707426816 BOT_CLIENTID=1093810443589529631 BOT_ENV=1 +BOT_VERBOSE=false BOT_ADMINS=147392775707426816,887272961504071690 ABOUT_FUNDING= diff --git a/.stage.env b/.stage.env index c2f65e6..d10e8bf 100644 --- a/.stage.env +++ b/.stage.env @@ -12,6 +12,7 @@ BOT_AUTHOR=Vylpes BOT_OWNERID=147392775707426816 BOT_CLIENTID=1147976642942214235 BOT_ENV=2 +BOT_VERBOSE=false BOT_ADMINS=147392775707426816,887272961504071690 ABOUT_FUNDING= diff --git a/src/client/appLogger.ts b/src/client/appLogger.ts index 4127e93..b06627b 100644 --- a/src/client/appLogger.ts +++ b/src/client/appLogger.ts @@ -1,9 +1,8 @@ -import { LogLevel } from "typeorm"; import { Logger, createLogger, format, transports } from "winston"; import { CoreClient } from "./client"; export default class AppLogger { - public static InitialiseLogger(logLevel: LogLevel, outputToConsole: boolean): Logger { + public static InitialiseLogger(logLevel: string, outputToConsole: boolean): Logger { const customFormat = format.printf(({ level, message, timestamp, label }) => { return `${timestamp} [${label}] ${level}: ${message}`; }); diff --git a/src/client/client.ts b/src/client/client.ts index 16056bd..b31cd3d 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -47,7 +47,9 @@ export class CoreClient extends Client { super({ intents: intents }); dotenv.config(); - CoreClient.Logger = AppLogger.InitialiseLogger("info", true); + CoreClient.Environment = Number(process.env.BOT_ENV); + + CoreClient.Logger = AppLogger.InitialiseLogger(process.env.BOT_VERBOSE == "true" ? "verbose" : "info", CoreClient.Environment == Environment.Local); CoreClient._commandItems = []; CoreClient._buttonEvents = []; @@ -56,7 +58,6 @@ export class CoreClient extends Client { this._util = new Util(); this._webhooks = new Webhooks(); - CoreClient.Environment = Number(process.env.BOT_ENV); console.log(`Bot Environment: ${CoreClient.Environment}`); CoreClient.AllowDrops = true;