refactor: remove time-stamp dependency

This commit is contained in:
2026-10-20 00:37:23 +03:00
parent 0edfb12473
commit 079cf9d52d
3 changed files with 13 additions and 5 deletions
+3 -2
View File
@@ -1,5 +1,4 @@
import colors from "ansi-colors";
import timestamp from "time-stamp";
const Level = {
VERBOSE: -1,
@@ -11,6 +10,8 @@ const Level = {
const level = process.argv.indexOf("--verbose") > -1 ? Level.VERBOSE : Level.INFO;
const formatTime = (date: Date): string => date.toTimeString().split(" ")[0];
export class Log {
static level = level;
@@ -28,7 +29,7 @@ export class Log {
static write(level: number, tag: string, pattern: string, ...args: any) {
if (level >= this.level) {
const message = `[${colors.gray(timestamp("HH:mm:ss"))}] ${colors.green(tag)} ${this.colorize(pattern)}`;
const message = `[${colors.gray(formatTime(new Date()))}] ${colors.green(tag)} ${this.colorize(pattern)}`;
console.log(message, ...args);
}
}