diff --git a/v2/dist/js/main.js b/v2/dist/js/main.js index 1168491..76385f2 100644 --- a/v2/dist/js/main.js +++ b/v2/dist/js/main.js @@ -55,9 +55,50 @@ return modules; }(src_js_modules_observermodule); src_js_utils = function () { - var Utils = function Utils() { - _classCallCheck(this, Utils); - }; + var Utils = function () { + function Utils() { + _classCallCheck(this, Utils); + } + _createClass(Utils, [ + { + key: 'log', + value: function log(msg) { + console.log('%c[BD] %c>> %c' + msg, 'color:#3e82e5; font-weight:700', 'color:#000; font-weight:700', ''); + } + }, + { + key: 'info', + value: function info(msg) { + console.info('%c[BD] %c>> %c' + msg, 'color:#3e82e5; font-weight:700', 'color:blue; font-weight:700', ''); + } + }, + { + key: 'warn', + value: function warn(msg) { + console.warn('%c[BD] %c>> %c' + msg, 'color:#3e82e5; font-weight:700', 'color:orange; font-weight:700', ''); + } + }, + { + key: 'err', + value: function err(msg) { + console.error('%c[BD] %c>> %c' + msg, 'color:#3e82e5; font-weight:700', 'color:red; font-weight:700', ''); + } + }, + { + key: 'dateString', + get: function get() { + return new Date().toLocaleString('en-GB'); + } + }, + { + key: 'timeString', + get: function get() { + return new Date().toTimeString().split(' ')[0]; + } + } + ]); + return Utils; + }(); return new Utils(); }(); src_js_api = function () { @@ -97,7 +138,7 @@ return Plugin; }(); src_js_event = function () { - var EventEmitter = events.EventEmitter; + var EventEmitter = new require('events').EventEmitter; var Event = function () { function Event() { _classCallCheck(this, Event); @@ -126,7 +167,7 @@ var Core = function () { function Core(args) { _classCallCheck(this, Core); - console.log(event); + this.utils = utils; this.event = event; this.modules = modules; this.beta = true; @@ -137,7 +178,7 @@ { key: 'init', value: function init() { - console.log('Initialized'); + utils.log(this.__versionString + ' Initializing'); } }, { diff --git a/v2/src/js/core.js b/v2/src/js/core.js index e28f6c6..8da3da7 100644 --- a/v2/src/js/core.js +++ b/v2/src/js/core.js @@ -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() { diff --git a/v2/src/js/utils.js b/v2/src/js/utils.js index 0582696..146c585 100644 --- a/v2/src/js/utils.js +++ b/v2/src/js/utils.js @@ -1,7 +1,7 @@ /* BetterDiscordApp Client Utilities * Version: 2:1.0 * Author: Jiiks | https://jiiks.net - * Date: 31/10/2016 + * Date: 04/11/2016 * Last Update: 31/10/2016 * Github: https://github.com/Jiiks/BetterDiscordApp * Git: https://github.com/Jiiks/BetterDiscordApp.git @@ -13,6 +13,34 @@ define(() => { class Utils { + constructor() { + + } + + log(msg) { + console.log(`%c[BD] %c>> %c${msg}`, 'color:#3e82e5; font-weight:700', 'color:#000; font-weight:700', '') + } + + info(msg) { + console.info(`%c[BD] %c>> %c${msg}`, 'color:#3e82e5; font-weight:700', 'color:#3e82e5; font-weight:700', '') + } + + warn(msg) { + console.warn(`%c[BD] %c>> %c${msg}`, 'color:#3e82e5; font-weight:700', 'color:orange; font-weight:700', '') + } + + err(msg) { + console.error(`%c[BD] %c>> %c${msg}`, 'color:#3e82e5; font-weight:700', 'color:red; font-weight:700', '') + } + + get dateString() { + return new Date().toLocaleString("en-GB"); + } + + get timeString() { + return new Date().toTimeString().split(' ')[0]; + } + } return new Utils();