SquadJS/core/logger.js

17 lines
371 B
JavaScript
Raw Normal View History

2020-10-25 09:24:48 -05:00
class Logger {
constructor() {
this.verboseness = {};
}
verbose(module, verboseness, message, ...extras) {
2020-10-25 09:28:36 -05:00
if ((this.verboseness[module] || 1) >= verboseness)
console.log(`[${module}][${verboseness}] ${message}`, ...extras);
2020-10-25 09:24:48 -05:00
}
setVerboseness(module, verboseness) {
this.verboseness[module] = verboseness;
}
}
2020-10-25 09:28:36 -05:00
export default new Logger();