(feature) Update UI & Resource Availability

This commit is contained in:
Elijah Dunemask 2023-03-15 15:20:08 +00:00
parent 11d8229eb5
commit 929193d272
44 changed files with 4747 additions and 27 deletions

28
lib/util/logging.js Normal file
View file

@ -0,0 +1,28 @@
// Imports
import { Chalk } from "chalk";
const { redBright, greenBright, yellowBright, cyanBright, magentaBright } =
new Chalk({ level: 2 });
// Logging
const logColor = (color, header, ...args) =>
console.log(color(header), ...args);
export const logError = (...args) => logColor(redBright, ...args);
export const logConfirm = (...args) => logColor(greenBright, ...args);
export const logWarn = (...args) => logColor(yellowBright, ...args);
export const logInfo = (...args) => logColor(cyanBright, ...args);
export const logVerbose = (...args) => logColor(magentaBright, ...args);
export const ERR = (header, ...args) => logError(`[${header}]`, ...args);
export const OK = (header, ...args) => logConfirm(`[${header}]`, ...args);
export const WARN = (header, ...args) => logWarn(`[${header}]`, ...args);
export const INFO = (header, ...args) => logInfo(`[${header}]`, ...args);
export const VERB = (header, ...args) => logVerbose(`[${header}]`, ...args);