mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-05 04:13:08 +02:00
Improve logging
This commit is contained in:
parent
00b85cd5dd
commit
9d46abcbb3
@ -127,7 +127,7 @@
|
||||
"off"
|
||||
],
|
||||
"no-console": [
|
||||
"off"
|
||||
"warn"
|
||||
],
|
||||
"no-prototype-builtins": [
|
||||
"off"
|
||||
|
@ -38,7 +38,7 @@ module.exports = config => {
|
||||
}
|
||||
|
||||
return new Logger({
|
||||
namespaces: ['commands', 'http', 'listeners', 'settings', 'tickets'],
|
||||
namespaces: ['autocomplete', 'buttons', 'commands', 'http', 'listeners', 'menus', 'modals', 'settings', 'tickets'],
|
||||
transports,
|
||||
});
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ module.exports = class extends Listener {
|
||||
}
|
||||
|
||||
run(autocompleter) {
|
||||
this.client.log.info(`Loaded "${autocompleter.id}" autocompleter`);
|
||||
this.client.log.info.autocomplete(`Loaded "${autocompleter.id}" autocompleter`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
19
src/listeners/autocomplete/run.js
Normal file
19
src/listeners/autocomplete/run.js
Normal file
@ -0,0 +1,19 @@
|
||||
const { Listener } = require('@eartharoid/dbf');
|
||||
|
||||
module.exports = class extends Listener {
|
||||
constructor(client, options) {
|
||||
super(client, {
|
||||
...options,
|
||||
emitter: client.autocomplete,
|
||||
event: 'run',
|
||||
});
|
||||
}
|
||||
|
||||
run({
|
||||
autocompleter,
|
||||
interaction,
|
||||
}) {
|
||||
this.client.log.verbose.autocomplete(`${interaction.user.tag} used the "${autocompleter.id}" autocompleter`);
|
||||
return true;
|
||||
}
|
||||
};
|
@ -10,7 +10,7 @@ module.exports = class extends Listener {
|
||||
}
|
||||
|
||||
run(button) {
|
||||
this.client.log.info(`Loaded "${button.id}" button`);
|
||||
this.client.log.info.buttons(`Loaded "${button.id}" button`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
19
src/listeners/buttons/run.js
Normal file
19
src/listeners/buttons/run.js
Normal file
@ -0,0 +1,19 @@
|
||||
const { Listener } = require('@eartharoid/dbf');
|
||||
|
||||
module.exports = class extends Listener {
|
||||
constructor(client, options) {
|
||||
super(client, {
|
||||
...options,
|
||||
emitter: client.buttons,
|
||||
event: 'run',
|
||||
});
|
||||
}
|
||||
|
||||
run({
|
||||
button,
|
||||
interaction,
|
||||
}) {
|
||||
this.client.log.info.buttons(`${interaction.user.tag} used the "${button.id}" button`);
|
||||
return true;
|
||||
}
|
||||
};
|
@ -10,7 +10,7 @@ module.exports = class extends Listener {
|
||||
}
|
||||
|
||||
run(menu) {
|
||||
this.client.log.info(`Loaded "${menu.id}" menu`);
|
||||
this.client.log.info.menus(`Loaded "${menu.id}" menu`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
19
src/listeners/menus/run.js
Normal file
19
src/listeners/menus/run.js
Normal file
@ -0,0 +1,19 @@
|
||||
const { Listener } = require('@eartharoid/dbf');
|
||||
|
||||
module.exports = class extends Listener {
|
||||
constructor(client, options) {
|
||||
super(client, {
|
||||
...options,
|
||||
emitter: client.menus,
|
||||
event: 'run',
|
||||
});
|
||||
}
|
||||
|
||||
run({
|
||||
menu,
|
||||
interaction,
|
||||
}) {
|
||||
this.client.log.info.menus(`${interaction.user.tag} used the "${menu.id}" menu`);
|
||||
return true;
|
||||
}
|
||||
};
|
@ -10,7 +10,7 @@ module.exports = class extends Listener {
|
||||
}
|
||||
|
||||
run(modal) {
|
||||
this.client.log.info(`Loaded "${modal.id}" modal`);
|
||||
this.client.log.info.modals(`Loaded "${modal.id}" modal`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
19
src/listeners/modals/run.js
Normal file
19
src/listeners/modals/run.js
Normal file
@ -0,0 +1,19 @@
|
||||
const { Listener } = require('@eartharoid/dbf');
|
||||
|
||||
module.exports = class extends Listener {
|
||||
constructor(client, options) {
|
||||
super(client, {
|
||||
...options,
|
||||
emitter: client.modals,
|
||||
event: 'run',
|
||||
});
|
||||
}
|
||||
|
||||
run({
|
||||
modal,
|
||||
interaction,
|
||||
}) {
|
||||
this.client.log.info.modals(`${interaction.user.tag} used the "${modal.id}" modal`);
|
||||
return true;
|
||||
}
|
||||
};
|
@ -10,6 +10,6 @@ module.exports = class extends Listener {
|
||||
}
|
||||
|
||||
run(commandName) {
|
||||
console.log('Unknown command:', commandName);
|
||||
this.client.log.warn('Unknown command:', commandName);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user