diff --git a/src/main.ts b/src/main.ts index f1dad36..1bdd13a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,7 +5,7 @@ import { Review, reviewSchema } from "./types"; import { checkFile, emp, Logger, Responder } from "./utils"; dotenv.config(); -const logger = new Logger(); +const logger = new Logger("Simple Review Server"); const response = new Responder(); // @ts-ignore const port = +process.env.PORT ?? 8080; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index d6fd477..34d4a31 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -5,11 +5,11 @@ export class Logger { private _err: string; private _main: string; - constructor() { + constructor(origin?: string) { this._wrn = chalk.yellow("[WARN] "); this._err = chalk.red("[ERROR] "); - this._main = chalk.bold.gray("[Simple Review Server] "); + this._main = chalk.bold.gray(`[${origin ?? "Anonymous"}] `); } public log(text: any, args?: any): void {