'use strict'; // #region Console const dbg = (...msg) => { const dt = new Date(); console.debug( '[%cMagic Userscript+%c] %cDBG', 'color: rgb(29, 155, 240);', '', 'color: rgb(255, 212, 0);', `[${dt.getHours()}:${('0' + dt.getMinutes()).slice(-2)}:${('0' + dt.getSeconds()).slice(-2)}]`, ...msg ); }; const err = (...msg) => { console.error( '[%cMagic Userscript+%c] %cERROR', 'color: rgb(29, 155, 240);', '', 'color: rgb(249, 24, 128);', ...msg ); for (const ex of msg) { if (typeof ex === 'object' && 'cause' in ex && typeof alert !== 'undefined') { alert(`[Magic Userscript+] (${ex.cause}) ${ex.message}`); } } }; const info = (...msg) => { console.info( '[%cMagic Userscript+%c] %cINF', 'color: rgb(29, 155, 240);', '', 'color: rgb(0, 186, 124);', ...msg ); }; const log = (...msg) => { console.log( '[%cMagic Userscript+%c] %cLOG', 'color: rgb(29, 155, 240);', '', 'color: rgb(219, 160, 73);', ...msg ); }; // #endregion export { dbg, err, info, log };