mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-22 15:53:08 +02:00
Improve logging
This commit is contained in:
parent
00b85cd5dd
commit
9d46abcbb3
@ -127,7 +127,7 @@
|
|||||||
"off"
|
"off"
|
||||||
],
|
],
|
||||||
"no-console": [
|
"no-console": [
|
||||||
"off"
|
"warn"
|
||||||
],
|
],
|
||||||
"no-prototype-builtins": [
|
"no-prototype-builtins": [
|
||||||
"off"
|
"off"
|
||||||
|
@ -38,7 +38,7 @@ module.exports = config => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Logger({
|
return new Logger({
|
||||||
namespaces: ['commands', 'http', 'listeners', 'settings', 'tickets'],
|
namespaces: ['autocomplete', 'buttons', 'commands', 'http', 'listeners', 'menus', 'modals', 'settings', 'tickets'],
|
||||||
transports,
|
transports,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ module.exports = class extends Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(autocompleter) {
|
run(autocompleter) {
|
||||||
this.client.log.info(`Loaded "${autocompleter.id}" autocompleter`);
|
this.client.log.info.autocomplete(`Loaded "${autocompleter.id}" autocompleter`);
|
||||||
return true;
|
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) {
|
run(button) {
|
||||||
this.client.log.info(`Loaded "${button.id}" button`);
|
this.client.log.info.buttons(`Loaded "${button.id}" button`);
|
||||||
return true;
|
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) {
|
run(menu) {
|
||||||
this.client.log.info(`Loaded "${menu.id}" menu`);
|
this.client.log.info.menus(`Loaded "${menu.id}" menu`);
|
||||||
return true;
|
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) {
|
run(modal) {
|
||||||
this.client.log.info(`Loaded "${modal.id}" modal`);
|
this.client.log.info.modals(`Loaded "${modal.id}" modal`);
|
||||||
return true;
|
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) {
|
run(commandName) {
|
||||||
console.log('Unknown command:', commandName);
|
this.client.log.warn('Unknown command:', commandName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user