Only log crashes

This commit is contained in:
Kallum Jones 2022-08-03 16:54:07 +01:00
parent 8a927d2f02
commit 4a16f8c69d
No known key found for this signature in database
GPG Key ID: D7F4589C4D7F81A9

View File

@ -1,38 +1,21 @@
import chalk from "chalk"; import chalk from "chalk";
import ora, { Ora } from "ora"; import ora, { Ora } from "ora";
import ModManager from "../mod-manager.js";
export default class PrintUtils { export default class PrintUtils {
static info(print: string) { static info(print: string) {
if (ModManager.logger != null) {
ModManager.logger.info(print);
}
console.log(chalk.white(print)); console.log(chalk.white(print));
} }
static warn(print: string) { static warn(print: string) {
if (ModManager.logger != null) {
ModManager.logger.warn(print)
}
console.log(chalk.yellowBright(print)); console.log(chalk.yellowBright(print));
} }
static success(print: string) { static success(print: string) {
if (ModManager.logger != null) {
ModManager.logger.info(print)
}
console.log(chalk.greenBright(print)); console.log(chalk.greenBright(print));
} }
static error(print: string) { static error(print: string) {
if (ModManager.logger != null) {
ModManager.logger.error(print);
}
console.log(chalk.redBright(print)); console.log(chalk.redBright(print));
} }