Reformat structure

This commit is contained in:
powermaker450 2024-08-17 01:39:16 -04:00
parent 342375d3b1
commit 466dd184b1
5 changed files with 33 additions and 2 deletions

View file

@ -1 +0,0 @@
export * from "./schema";

2
src/utils/index.ts Normal file
View file

@ -0,0 +1,2 @@
export * from "./logger";
export * from "./utils";

30
src/utils/logger.ts Normal file
View file

@ -0,0 +1,30 @@
import chalk from "chalk";
export class Logger {
private _wrn: string;
private _err: string;
private _main: string;
constructor() {
this._wrn = chalk.yellow("[WARN] ");
this._err = chalk.red("[ERROR] ");
this._main = chalk.bold.gray("[Simple Review Server] ");
}
log(text: any, args?: any): void {
args ? console.log(this._main + text, args) : console.log(this._main + text);
}
warn(text: any, args?: any): void {
args ? console.warn(this._wrn + this._main + text, args) : console.warn(this._wrn + this._main + text);
}
error(text: any, args?: any): void {
args ? console.error(this._err + this._main + text, args) : console.error(this._err + this._main + text);
}
}
export const emp = chalk.green;
export const wrn = chalk.yellow;
export const err = chalk.red;

View file

@ -1,5 +1,5 @@
import fs from "fs"; import fs from "fs";
import { Review } from "./types"; import { Review } from "../types";
export const dir = "./persist/"; export const dir = "./persist/";