mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Update format to logging
This commit is contained in:
1 parent
03d087518e
commit
9d40920b32
1 file changed
+6
-6
@@ -78,7 +78,7 @@ client.on('error', console.error);
|
|||||||
|
|
||||||
client.on('guildCreate', (guild) => {
|
client.on('guildCreate', (guild) => {
|
||||||
console.log(
|
console.log(
|
||||||
`${new Date().toISOString().substring(11, 19)}: Info: ${
|
`${new Date().toISOString().substring(11, 19)}: Info: ➡️ ${
|
||||||
client.user.tag
|
client.user.tag
|
||||||
} has been added to server '${guild.name} (#${guild.memberCount})'!`
|
} has been added to server '${guild.name} (#${guild.memberCount})'!`
|
||||||
);
|
);
|
||||||
@@ -86,7 +86,7 @@ client.on('guildCreate', (guild) => {
|
|||||||
|
|
||||||
client.on('guildDelete', (guild) => {
|
client.on('guildDelete', (guild) => {
|
||||||
console.log(
|
console.log(
|
||||||
`${new Date().toISOString().substring(11, 19)}: Info: ${
|
`${new Date().toISOString().substring(11, 19)}: Info: ⬅️ ${
|
||||||
client.user.tag
|
client.user.tag
|
||||||
} was removed from server '${guild.name} (#${guild.memberCount})'!`
|
} was removed from server '${guild.name} (#${guild.memberCount})'!`
|
||||||
);
|
);
|
||||||
@@ -107,17 +107,17 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
const outputTime = new Date();
|
const outputTime = new Date();
|
||||||
const executionTime = outputTime - inputTime;
|
const executionTime = outputTime - inputTime;
|
||||||
console.log(
|
console.log(
|
||||||
`${new Date().toISOString().substring(11, 19)}: ${
|
`${new Date().toISOString().substring(11, 19)}: Info: ${
|
||||||
interaction.guild.name
|
interaction.guild.name
|
||||||
} (#${interaction.guild.memberCount})> Ran command '/${
|
} (#${interaction.guild.memberCount})> Command '/${
|
||||||
interaction.commandName
|
interaction.commandName
|
||||||
}' successfully in ${executionTime} ms.`
|
}' executed in ${executionTime} ms.`
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// log error to console with full object depth
|
// log error to console with full object depth
|
||||||
console.dir(error, { depth: null });
|
console.dir(error, { depth: null });
|
||||||
console.log(
|
console.log(
|
||||||
`${new Date().toISOString().substring(11, 19)}: ${
|
`${new Date().toISOString().substring(11, 19)}: Error: 🚨 ${
|
||||||
interaction.guild.name
|
interaction.guild.name
|
||||||
} (#${interaction.guild.memberCount})> Command '/${
|
} (#${interaction.guild.memberCount})> Command '/${
|
||||||
interaction.commandName
|
interaction.commandName
|
||||||
|
|||||||
Reference in new issue
Block a user