Migrate to dyetty

This commit is contained in:
Holly Stubbs 2023-07-28 12:38:43 +01:00
parent c8b4a2f756
commit 247ecb3484
3 changed files with 23 additions and 2048 deletions

View file

@ -1,4 +1,4 @@
import chalk from "chalk";
import * as dyetty from "dyetty";
import { createWriteStream, mkdirSync, existsSync } from "fs";
console.clear();
@ -17,10 +17,10 @@ enum LogTag {
}
const LogTags = [
chalk.bgGreen(chalk.black(" INFO ")),
chalk.bgCyan(chalk.black(" CHAT ")),
chalk.bgYellow(chalk.black(" WARN ")),
chalk.bgRed(" ERRR ")
dyetty.bgGreen(dyetty.black(" INFO ")),
dyetty.bgCyan(dyetty.black(" CHAT ")),
dyetty.bgYellow(dyetty.black(" WARN ")),
dyetty.bgRed(" ERRR ")
] as const;
const TagsForFile = [
@ -48,11 +48,11 @@ function log(tag:LogTag, log:string, logType:LogType = LogType.INFO) : void {
Console.QUEUED_FOR_LOG += `${stringTime} ${fileTag} ${log}\n`;
switch (logType) {
case LogType.INFO:
return console.log(`${chalk.green(stringTime)} ${consoleTag} ${log}`);
return console.log(`${dyetty.green(stringTime)} ${consoleTag} ${log}`);
case LogType.WARN:
return console.warn(`${chalk.green(stringTime)} ${consoleTag} ${log}`);
return console.warn(`${dyetty.green(stringTime)} ${consoleTag} ${log}`);
case LogType.ERROR:
return console.error(`${chalk.green(stringTime)} ${consoleTag} ${log}`);
return console.error(`${dyetty.green(stringTime)} ${consoleTag} ${log}`);
}
}

2053
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,7 @@
"homepage": "https://github.com/tgpholly/mc-beta-server#readme",
"dependencies": {
"bufferstuff": "^1.3.0",
"chalk": "^4.1.2"
"dyetty": "^1.0.1"
},
"devDependencies": {
"@types/node": "^20.4.5",