Timestamps and init log

This commit is contained in:
Jiiks 2016-11-04 06:49:51 +02:00
parent 5dc6327fda
commit 48e55c9417
2 changed files with 13 additions and 5 deletions

View File

@ -20,7 +20,7 @@ define([
class Core {
constructor(args) {
console.log(event);
this.utils = utils;
this.event = event;
this.modules = modules;
this.beta = true;
@ -29,7 +29,7 @@ define([
}
init() {
console.log("Initialized");
utils.log(`${this.__versionString} Initializing`);
}
get __version() {

View File

@ -18,15 +18,23 @@ define(() => {
}
log(msg) {
console.log(`%c[%cBetterDiscord|INF%c] %c${msg}`, 'color: #000;', 'color: green; font-weight:#000;', 'color:#00;', '');
console.log(`[${this.timeString}]%c[%cBetterDiscord|INF%c] %c${msg}`, 'color: #000;', 'color: green; font-weight:#000;', 'color:#00;', '');
}
warn(msg) {
console.log(`%c[%cBetterDiscord|WRN%c] %c${msg}`, 'color: #000;', 'color: orange; font-weight:700;', 'color:#000;', '');
console.log(`[${this.timeString}]%c[%cBetterDiscord|WRN%c] %c${msg}`, 'color: #000;', 'color: orange; font-weight:700;', 'color:#000;', '');
}
err(msg) {
console.log(`%c[%cBetterDiscord|ERR%c] %c${msg}`, 'color: #000;', 'color: red; font-weight:700;', 'color:#000;', '');
console.log(`[${this.timeString}]%c[%cBetterDiscord|ERR%c] %c${msg}`, 'color: #000;', 'color: red; font-weight:700;', 'color:#000;', '');
}
get dateString() {
return new Date().toLocaleString("en-GB");
}
get timeString() {
return new Date().toTimeString().split(' ')[0];
}
}