Add logger to project #183
5 changed files with 8 additions and 4 deletions
2
.dev.env
2
.dev.env
|
@ -12,7 +12,7 @@ BOT_AUTHOR=Vylpes
|
||||||
BOT_OWNERID=147392775707426816
|
BOT_OWNERID=147392775707426816
|
||||||
BOT_CLIENTID=682942374040961060
|
BOT_CLIENTID=682942374040961060
|
||||||
BOT_ENV=4
|
BOT_ENV=4
|
||||||
BOT_VERBOSE=false
|
BOT_LOGLEVEL=info
|
||||||
BOT_ADMINS=147392775707426816,887272961504071690
|
BOT_ADMINS=147392775707426816,887272961504071690
|
||||||
|
|
||||||
ABOUT_FUNDING=
|
ABOUT_FUNDING=
|
||||||
|
|
|
@ -12,7 +12,7 @@ BOT_AUTHOR=Vylpes
|
||||||
BOT_OWNERID=147392775707426816
|
BOT_OWNERID=147392775707426816
|
||||||
BOT_CLIENTID=1093810443589529631
|
BOT_CLIENTID=1093810443589529631
|
||||||
BOT_ENV=1
|
BOT_ENV=1
|
||||||
BOT_VERBOSE=false
|
BOT_LOGLEVEL=info
|
||||||
BOT_ADMINS=147392775707426816,887272961504071690
|
BOT_ADMINS=147392775707426816,887272961504071690
|
||||||
|
|
||||||
ABOUT_FUNDING=
|
ABOUT_FUNDING=
|
||||||
|
|
|
@ -12,7 +12,7 @@ BOT_AUTHOR=Vylpes
|
||||||
BOT_OWNERID=147392775707426816
|
BOT_OWNERID=147392775707426816
|
||||||
BOT_CLIENTID=1147976642942214235
|
BOT_CLIENTID=1147976642942214235
|
||||||
BOT_ENV=2
|
BOT_ENV=2
|
||||||
BOT_VERBOSE=false
|
BOT_LOGLEVEL=info
|
||||||
BOT_ADMINS=147392775707426816,887272961504071690
|
BOT_ADMINS=147392775707426816,887272961504071690
|
||||||
|
|
||||||
ABOUT_FUNDING=
|
ABOUT_FUNDING=
|
||||||
|
|
|
@ -35,6 +35,8 @@ export default class AppLogger {
|
||||||
}
|
}
|
||||||
|
|
||||||
AppLogger.Logger = logger;
|
AppLogger.Logger = logger;
|
||||||
|
|
||||||
|
AppLogger.LogInfo('AppLogger', `Log Level: ${logLevel}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LogError(label: string, message: string) {
|
public static LogError(label: string, message: string) {
|
||||||
|
|
|
@ -47,7 +47,9 @@ export class CoreClient extends Client {
|
||||||
|
|
||||||
CoreClient.Environment = Number(process.env.BOT_ENV);
|
CoreClient.Environment = Number(process.env.BOT_ENV);
|
||||||
|
|
||||||
AppLogger.InitialiseLogger(process.env.BOT_VERBOSE == "true" ? "verbose" : "info", CoreClient.Environment == Environment.Local);
|
const loglevel = process.env.BOT_LOGLEVEL ?? "info";
|
||||||
|
|
||||||
|
AppLogger.InitialiseLogger(loglevel, CoreClient.Environment == Environment.Local);
|
||||||
|
|
||||||
AppLogger.LogInfo("Client", "Initialising Client");
|
AppLogger.LogInfo("Client", "Initialising Client");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue