Replit Commit
This commit is contained in:
commit
f49f965a42
41 changed files with 32720 additions and 0 deletions
28
lib/util/logging.js
Normal file
28
lib/util/logging.js
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue