Log more startup stuff

This commit is contained in:
Dragon Fire
2021-03-23 22:20:24 -04:00
parent 03421aa7b7
commit 0b2accb3df
+21 -3
View File
@@ -74,7 +74,11 @@ client.on('ready', async () => {
// Import command-leaderboard.json // Import command-leaderboard.json
try { try {
const results = client.importCommandLeaderboard(); const results = client.importCommandLeaderboard();
if (!results) client.logger.error('[LEADERBOARD] command-leaderboard.json is not formatted correctly.'); if (results) {
client.logger.info('[LEADERBOARD] command-leaderboard.json successfully loaded.');
} else {
client.logger.error('[LEADERBOARD] command-leaderboard.json is not formatted correctly.');
}
} catch (err) { } catch (err) {
client.logger.error(`[LEADERBOARD] Could not parse command-leaderboard.json:\n${err.stack}`); client.logger.error(`[LEADERBOARD] Could not parse command-leaderboard.json:\n${err.stack}`);
} }
@@ -82,7 +86,11 @@ client.on('ready', async () => {
// Import command-last-run.json // Import command-last-run.json
try { try {
const results = client.importLastRun(); const results = client.importLastRun();
if (!results) client.logger.error('[LASTRUN] command-last-run.json is not formatted correctly.'); if (results) {
client.logger.info('[LASTRUN] command-last-run.json successfully loaded.');
} else {
client.logger.error('[LASTRUN] command-last-run.json is not formatted correctly.');
}
} catch (err) { } catch (err) {
client.logger.error(`[LASTRUN] Could not parse command-last-run.json:\n${err.stack}`); client.logger.error(`[LASTRUN] Could not parse command-last-run.json:\n${err.stack}`);
} }
@@ -91,11 +99,13 @@ client.on('ready', async () => {
client.setInterval(() => { client.setInterval(() => {
try { try {
client.exportCommandLeaderboard(); client.exportCommandLeaderboard();
client.logger.info('[LEADERBOARD] command-leaderboard.json successfully exported.');
} catch (err) { } catch (err) {
client.logger.error(`[LEADERBOARD] Failed to export command-leaderboard.json:\n${err.stack}`); client.logger.error(`[LEADERBOARD] Failed to export command-leaderboard.json:\n${err.stack}`);
} }
try { try {
client.exportLastRun(); client.exportLastRun();
client.logger.info('[LASTRUN] command-last-run.json successfully exported.');
} catch (err) { } catch (err) {
client.logger.error(`[LASTRUN] Failed to export command-last-run.json:\n${err.stack}`); client.logger.error(`[LASTRUN] Failed to export command-last-run.json:\n${err.stack}`);
} }
@@ -104,7 +114,11 @@ client.on('ready', async () => {
// Import blacklist // Import blacklist
try { try {
const results = client.importBlacklist(); const results = client.importBlacklist();
if (!results) client.logger.error('[BLACKLIST] blacklist.json is not formatted correctly.'); if (results) {
client.logger.info('[BLACKLIST] blacklist.json successfully loaded.');
} else {
client.logger.error('[BLACKLIST] blacklist.json is not formatted correctly.');
}
} catch (err) { } catch (err) {
client.logger.error(`[BLACKLIST] Could not parse blacklist.json:\n${err.stack}`); client.logger.error(`[BLACKLIST] Could not parse blacklist.json:\n${err.stack}`);
} }
@@ -137,13 +151,16 @@ client.on('ready', async () => {
// Set up existing timers // Set up existing timers
await client.timers.fetchAll(); await client.timers.fetchAll();
client.logger.info('[TIMERS] All timers imported.');
// Register all canvas fonts // Register all canvas fonts
await client.registerFontsIn(path.join(__dirname, 'assets', 'fonts')); await client.registerFontsIn(path.join(__dirname, 'assets', 'fonts'));
client.logger.info('[FONTS] All fonts loaded.');
// Fetch adult site list // Fetch adult site list
try { try {
await client.fetchAdultSiteList(); await client.fetchAdultSiteList();
client.logger.info('[ADULT SITES] Fetched adult site list.');
} catch (err) { } catch (err) {
client.logger.error(`[ADULT SITES] Failed to fetch list\n${err.stack}`); client.logger.error(`[ADULT SITES] Failed to fetch list\n${err.stack}`);
} }
@@ -151,6 +168,7 @@ client.on('ready', async () => {
// Fetch NSFW model // Fetch NSFW model
try { try {
await client.loadNSFWModel(); await client.loadNSFWModel();
client.logger.info('[NSFW MODEL] Loaded NSFW model.');
} catch (err) { } catch (err) {
client.logger.error(`[NSFW MODEL] Failed to load NSFW model\n${err.stack}`); client.logger.error(`[NSFW MODEL] Failed to load NSFW model\n${err.stack}`);
} }