Compare commits

..

No commits in common. "f812185937696f874c9b30fa7f0ee6344ad412c4" and "efc0186db23600daa39a117a7ed1006139ecdb8f" have entirely different histories.

5 changed files with 21 additions and 25 deletions

View file

@ -12,7 +12,7 @@ BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=682942374040961060
BOT_ENV=4
BOT_LOGLEVEL=info
BOT_VERBOSE=false
BOT_ADMINS=147392775707426816,887272961504071690
ABOUT_FUNDING=

View file

@ -12,7 +12,7 @@ BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=1093810443589529631
BOT_ENV=1
BOT_LOGLEVEL=info
BOT_VERBOSE=false
BOT_ADMINS=147392775707426816,887272961504071690
ABOUT_FUNDING=

View file

@ -12,7 +12,7 @@ BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=1147976642942214235
BOT_ENV=2
BOT_LOGLEVEL=info
BOT_VERBOSE=false
BOT_ADMINS=147392775707426816,887272961504071690
ABOUT_FUNDING=

View file

@ -12,16 +12,16 @@ export default class AppLogger {
level: logLevel,
format: format.combine(
format.timestamp({
format: "YYYY-MM-DD HH:mm:ss"
format: 'YYYY-MM-DD HH:mm:ss'
}),
format.errors({ stack: true }),
format.splat(),
customFormat,
),
defaultMeta: { service: "bot" },
defaultMeta: { service: 'bot' },
transports: [
new transports.File({ filename: "error.log", level: "error" }),
new transports.File({ filename: "combined.log" }),
new transports.File({ filename: 'error.log', level: 'error' }),
new transports.File({ filename: 'combined.log' }),
],
});
@ -31,12 +31,10 @@ export default class AppLogger {
format.colorize(),
format.timestamp(),
customFormat,
)}));
)}));
}
AppLogger.Logger = logger;
AppLogger.LogInfo("AppLogger", `Log Level: ${logLevel}`);
}
public static LogError(label: string, message: string) {

View file

@ -47,9 +47,7 @@ export class CoreClient extends Client {
CoreClient.Environment = Number(process.env.BOT_ENV);
const loglevel = process.env.BOT_LOGLEVEL ?? "info";
AppLogger.InitialiseLogger(loglevel, CoreClient.Environment == Environment.Local);
AppLogger.InitialiseLogger(process.env.BOT_VERBOSE == "true" ? "verbose" : "info", CoreClient.Environment == Environment.Local);
AppLogger.LogInfo("Client", "Initialising Client");
@ -127,7 +125,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Channel Create Event");
AppLogger.LogVerbose("Client", `Registered Channel Create Event`);
}
public static RegisterChannelDeleteEvent(fn: (channel: DMChannel | NonThreadGuildBasedChannel) => void) {
@ -150,7 +148,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Channel Delete Event");
AppLogger.LogVerbose("Client", `Registered Channel Delete Event`);
}
public static RegisterChannelUpdateEvent(fn: (channel: DMChannel | NonThreadGuildBasedChannel) => void) {
@ -173,7 +171,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Channel Update Event");
AppLogger.LogVerbose("Client", `Registered Channel Update Event`);
}
public static RegisterGuildBanAddEvent(fn: (ban: GuildBan) => void) {
@ -196,7 +194,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Guild Ban Add Event");
AppLogger.LogVerbose("Client", `Registered Guild Ban Add Event`);
}
public static RegisterGuildBanRemoveEvent(fn: (channel: GuildBan) => void) {
@ -219,7 +217,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Guild Ban Remove Event");
AppLogger.LogVerbose("Client", `Registered Guild Ban Remove Event`);
}
public static RegisterGuildCreateEvent(fn: (guild: Guild) => void) {
@ -242,7 +240,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Guild Create Event");
AppLogger.LogVerbose("Client", `Registered Guild Create Event`);
}
public static RegisterGuildMemberAddEvent(fn: (member: GuildMember) => void) {
@ -265,7 +263,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Guild Member Add Event");
AppLogger.LogVerbose("Client", `Registered Guild Member Add Event`);
}
public static RegisterGuildMemberRemoveEvent(fn: (member: GuildMember | PartialGuildMember) => void) {
@ -288,7 +286,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Guild Member Remove Event");
AppLogger.LogVerbose("Client", `Registered Guild Member Remove Event`);
}
public static GuildMemebrUpdate(fn: (oldMember: GuildMember | PartialGuildMember, newMember: GuildMember) => void) {
@ -311,7 +309,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Guild Member Update Event");
AppLogger.LogVerbose("Client", `Registered Guild Member Update Event`);
}
public static RegisterMessageCreateEvent(fn: (message: Message<boolean>) => void) {
@ -334,7 +332,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Message Create Event");
AppLogger.LogVerbose("Client", `Registered Message Create Event`);
}
public static RegisterMessageDeleteEvent(fn: (message: Message<boolean> | PartialMessage) => void) {
@ -357,7 +355,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Message Delete Event");
AppLogger.LogVerbose("Client", `Registered Message Delete Event`);
}
public static RegisterMessageUpdateEvent(fn: (oldMessage: Message<boolean> | PartialMessage, newMessage: Message<boolean> | PartialMessage) => void) {
@ -380,7 +378,7 @@ export class CoreClient extends Client {
};
}
AppLogger.LogVerbose("Client", "Registered Message Update Event");
AppLogger.LogVerbose("Client", `Registered Message Update Event`);
}
public static RegisterButtonEvent(buttonId: string, event: ButtonEvent, environment: Environment = Environment.All) {