js-randomness-predictor
Version:
Predict Math.random output in Node, Chrome, and Firefox
21 lines (20 loc) • 542 B
JavaScript
function redText(text) {
return `\x1b[31m${text}\x1b[0m`;
}
function yellowText(s) {
return `\x1b[33m${s}\x1b[0m`;
}
export default class Logger {
static info(...messages) {
console.info(`[INFO] ${messages.join(" ")}`);
}
static log(...messages) {
console.log(`[LOG] ${messages.join(" ")}`);
}
static warn(...messages) {
console.warn(yellowText(`[WARN] ${messages.join(" ")}`));
}
static error(...messages) {
console.error(redText(`[ERROR] ${messages.join(" ")}`));
}
}