feat(domains) implement domain routing; Logger

This commit is contained in:
gh0sTedBuddy
2024-03-20 03:43:27 +00:00
parent f303b67409
commit b5e8ce3144
15 changed files with 907 additions and 187 deletions

View File

@@ -1,5 +1,15 @@
export class Logger {
static info() {
const [message, data] = arguments;
const LOGGING_TYPES = ['log', 'debug', 'error', 'warn', 'info'];
function Logger (data, type = 'debug') {
if(!process.env.DEBUG) return;
if(LOGGING_TYPES.indexOf(type) < 0) type = 'log';
console[type](...(Array.isArray(data) ? data : [data]));
}
for(const k of LOGGING_TYPES) {
Logger.prototype[k] = function() {
Logger(arguments, k);
}
}
export default Logger;