Merge pull request #326 from ZynerOrg/dev

2022.05.0 hotfix
This commit is contained in:
Axel Olausson Holtenäs 2022-05-20 23:14:56 +02:00 committed by GitHub
commit b8d3b64f07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 56 deletions

View file

@ -17,43 +17,19 @@ const main = async () => {
});
// Start database manager
await database()
.then(async () => {
await logger.silly("Database process started");
})
.catch(async (err) => {
await logger.error(`${err}`);
});
await database();
// Start schedule manager
await schedules(client)
.then(async () => {
await logger.silly("Schedules process started");
})
.catch(async (err) => {
await logger.error(`${err}`);
});
await schedules(client);
// Start command handler
await commands(client)
.then(async () => {
await logger.silly("Commands process started");
})
.catch(async (err) => {
await logger.error(`${err}`);
});
await commands(client);
// Start event handler
await events(client)
.then(async () => {
await logger.silly("Events process started");
})
.catch(async (err) => {
await logger.error(`${err}`);
});
await events(client);
// Authorize with Discord's API
await client.login(token);
};
main()
main();

View file

@ -3,31 +3,24 @@ import "winston-daily-rotate-file";
const { combine, timestamp, printf, colorize, align, json } = winston.format;
module.exports = {
// Logger initialized async-hronously
logger: async () => {
return winston.createLogger({
level: process.env.LOG_LEVEL || "silly",
transports: [
new winston.transports.DailyRotateFile({
filename: "logs/combined-%DATE%.log",
datePattern: "YYYY-MM-DD",
maxFiles: "14d",
format: combine(timestamp(), json()),
export default winston.createLogger({
level: process.env.LOG_LEVEL || "silly",
transports: [
new winston.transports.DailyRotateFile({
filename: "logs/combined-%DATE%.log",
datePattern: "YYYY-MM-DD",
maxFiles: "14d",
format: combine(timestamp(), json()),
}),
new winston.transports.Console({
format: combine(
colorize({ all: true }),
timestamp({
format: "YYYY-MM-DD HH:MM:ss",
}),
new winston.transports.Console({
format: combine(
colorize({ all: true }),
timestamp({
format: "YYYY-MM-DD HH:MM:ss",
}),
align(),
printf(
(info) => `[${info.timestamp}] ${info.level}: ${info.message}`
)
),
}),
],
});
},
};
align(),
printf((info) => `[${info.timestamp}] ${info.level}: ${info.message}`)
),
}),
],
});