Add execution time to command logging
This commit is contained in:
parent
c2e88c9948
commit
af4c08b220
1 changed files with 4 additions and 2 deletions
|
@ -37,12 +37,14 @@ module.exports = function(client, owners, message, globalPrefix){
|
||||||
}
|
}
|
||||||
if (command.admin && owners.indexOf(message.author.id.toString()) == -1) return;
|
if (command.admin && owners.indexOf(message.author.id.toString()) == -1) return;
|
||||||
try {
|
try {
|
||||||
|
let t0 = performance.now();
|
||||||
command.execute({ message: message, args: args, client: client, prefix: prefix, owners: owners, globalPrefix: globalPrefix})
|
command.execute({ message: message, args: args, client: client, prefix: prefix, owners: owners, globalPrefix: globalPrefix})
|
||||||
console.log(`${message.author.username}(id: ${message.author.id}) executed ${command.name} with '${args}' as arguments`)
|
let t1 = performance.now();
|
||||||
|
console.log(`${message.author.username}(id: ${message.author.id}) executed ${command.name} with '${args}' as arguments in ${(t1-t0).toFixed(2)} ms`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
let divider = "------------------------"
|
let divider = "------------------------"
|
||||||
console.log(divider)
|
console.log(divider)
|
||||||
console.error(error)
|
console.error(error)
|
||||||
console.log(divider)
|
console.log(divider)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue