@anjianshi/utils 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/env-node/logging.d.ts +5 -6
- package/package.json +2 -1
- package/src/env-node/logging.ts +2 -2
package/env-node/logging.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
1
|
import { type Logger, type LogInfo, LogHandler } from '../logging/index.js';
|
|
3
2
|
export * from '../logging/index.js';
|
|
4
3
|
/**
|
|
@@ -25,14 +24,14 @@ export declare class ConsoleHandler extends LogHandler {
|
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
static readonly levelColors: {
|
|
28
|
-
1: chalk.
|
|
29
|
-
2: chalk.
|
|
30
|
-
3: chalk.
|
|
31
|
-
4: chalk.
|
|
27
|
+
1: import("chalk").ChalkInstance;
|
|
28
|
+
2: import("chalk").ChalkInstance;
|
|
29
|
+
3: import("chalk").ChalkInstance;
|
|
30
|
+
4: import("chalk").ChalkInstance;
|
|
32
31
|
};
|
|
33
32
|
private static readonly loggerColors;
|
|
34
33
|
private static readonly loggerColorMap;
|
|
35
|
-
static getLoggerColor(logger: string): "green" | "yellow" | "blue" | "
|
|
34
|
+
static getLoggerColor(logger: string): "green" | "yellow" | "blue" | "cyan" | "magenta" | "greenBright" | "yellowBright" | "blueBright" | "cyanBright" | "magentaBright";
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* 写入文件日志
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anjianshi/utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Common JavaScript Utils",
|
|
5
5
|
"homepage": "https://github.com/anjianshi/js-utils",
|
|
6
6
|
"bugs": {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@types/debug": "^4.1.9",
|
|
37
37
|
"@types/lodash": "^4.14.199",
|
|
38
38
|
"@types/node": "^20.8.6",
|
|
39
|
+
"chalk": "^5.3.0",
|
|
39
40
|
"vconsole": "^3.15.1"
|
|
40
41
|
},
|
|
41
42
|
"eslintIgnore": [],
|
package/src/env-node/logging.ts
CHANGED
|
@@ -128,7 +128,7 @@ export class FileHandler extends LogHandler {
|
|
|
128
128
|
totalLength += itemString.length
|
|
129
129
|
} else {
|
|
130
130
|
itemStrings.push(
|
|
131
|
-
itemString.slice(0, this.options.maxLength - totalLength) + ' [too long, sliced]'
|
|
131
|
+
itemString.slice(0, this.options.maxLength - totalLength) + ' [too long, sliced]'
|
|
132
132
|
)
|
|
133
133
|
break
|
|
134
134
|
}
|
|
@@ -179,7 +179,7 @@ export class FileHandler extends LogHandler {
|
|
|
179
179
|
const { dir, filePrefix } = this.options
|
|
180
180
|
return path.join(
|
|
181
181
|
dir,
|
|
182
|
-
`${filePrefix ? `${filePrefix}-` : ''}${dayjs().format('YYYY-MM-DD')}.log
|
|
182
|
+
`${filePrefix ? `${filePrefix}-` : ''}${dayjs().format('YYYY-MM-DD')}.log`
|
|
183
183
|
)
|
|
184
184
|
}
|
|
185
185
|
|