const consoleStyles = { 'init': 'font: bold 1.4em/1 Arial; color: darkviolet;', 'info': 'font: 1.4em Arial; color: midnightblue;', 'error': 'padding: 0 .5rem; background: crimson; font: 1.5em/1 Arial; color: white;', 'from': 'padding: 0 .5rem; background: crimson; font: 1.5em/1 Arial; color: yellow;' }; function mes(...args) { let message = ''; for (let i = 0; i < arguments.length; i++) { message += arguments[i] + ' '; } return message; } export default class Log { static info(...args) { console.log(`%c${mes(...args)}`, consoleStyles['info']) } static show(...args) { console.log(`%c${mes(...args)}`, consoleStyles['init']) } static errorFrom(obj, ...args) { console.log(`%c${obj.constructor.name}%c${mes(...args)}`, consoleStyles['from'], consoleStyles['error']) } static error(...args) { console.log(`%c${mes(...args)}`, consoleStyles['error']) } }; // // global.error = function (...args) { // Log.error(...args); // }; // // global.show = function (...args) { // Log.show(...args); // }; // // global.log = function (...args) { // console.log(...args); // }; // // global.info = function (...args) { // Log.info(...args); // };