refactor: remove time-stamp dependency
This commit is contained in:
Generated
+8
-1
@@ -32,13 +32,13 @@
|
||||
"tail": "^1.2.3",
|
||||
"tar": "^7.5.22",
|
||||
"through2": "^2.0.3",
|
||||
"time-stamp": "^1.1.0",
|
||||
"tmp-file": "^2.0.1",
|
||||
"unzip-stream": "^0.3.4",
|
||||
"vinyl": "^2.1.0",
|
||||
"vinyl-fs": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/async": "^3.2.26",
|
||||
"@types/cli-progress": "^3.11.6",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/gulp": "^4.0.18",
|
||||
@@ -628,6 +628,13 @@
|
||||
"url": "https://github.com/sindresorhus/is?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/async": {
|
||||
"version": "3.2.26",
|
||||
"resolved": "https://registry.npmjs.org/@types/async/-/async-3.2.26.tgz",
|
||||
"integrity": "sha512-KqX2Cp6N7C0KEpExkHkDalNgx9ohk8oxjDM9ygtFTJr5BsHaiKWYjVnUQusGnc8A1jOoJuzldeazVRZuFYxjfw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/cli-progress": {
|
||||
"version": "3.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.11.6.tgz",
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
"scripts": {
|
||||
"build": "tsdown",
|
||||
"dev": "tsdown --watch",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "tsc --noEmit",
|
||||
"test": "node --test"
|
||||
},
|
||||
"repository": {
|
||||
@@ -52,13 +52,13 @@
|
||||
"tail": "^1.2.3",
|
||||
"tar": "^7.5.22",
|
||||
"through2": "^2.0.3",
|
||||
"time-stamp": "^1.1.0",
|
||||
"tmp-file": "^2.0.1",
|
||||
"unzip-stream": "^0.3.4",
|
||||
"vinyl": "^2.1.0",
|
||||
"vinyl-fs": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/async": "^3.2.26",
|
||||
"@types/cli-progress": "^3.11.6",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/gulp": "^4.0.18",
|
||||
|
||||
+3
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user