@eggjs/logrotator 5.0.0-beta.19 → 5.0.0-beta.21
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/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -6
- package/dist/app/extend/agent.d.ts +3 -6
- package/dist/app/extend/agent.js +5 -6
- package/dist/app/extend/application.d.ts +3 -6
- package/dist/app/extend/application.js +4 -6
- package/dist/app/schedule/clean_log.d.ts +7 -10
- package/dist/app/schedule/clean_log.js +66 -56
- package/dist/app/schedule/rotate_by_file.d.ts +8 -11
- package/dist/app/schedule/rotate_by_file.js +13 -17
- package/dist/app/schedule/rotate_by_hour.d.ts +8 -11
- package/dist/app/schedule/rotate_by_hour.js +13 -17
- package/dist/app/schedule/rotate_by_size.d.ts +8 -11
- package/dist/app/schedule/rotate_by_size.js +13 -17
- package/dist/app.d.ts +2 -2
- package/dist/app.js +2 -6
- package/dist/boot.d.ts +5 -9
- package/dist/boot.js +14 -16
- package/dist/config/config.default.d.ts +57 -59
- package/dist/config/config.default.js +14 -15
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/lib/day_rotator.d.ts +7 -11
- package/dist/lib/day_rotator.js +78 -62
- package/dist/lib/hour_rotator.d.ts +5 -9
- package/dist/lib/hour_rotator.js +38 -37
- package/dist/lib/rotator.d.ts +13 -17
- package/dist/lib/rotator.js +71 -54
- package/dist/lib/size_rotator.d.ts +4 -8
- package/dist/lib/size_rotator.js +66 -60
- package/dist/lib/utils.d.ts +5 -7
- package/dist/lib/utils.js +14 -13
- package/dist/types.d.ts +16 -18
- package/dist/types.js +2 -1
- package/package.json +6 -6
package/dist/lib/utils.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
//#region src/lib/utils.ts
|
|
2
1
|
/**
|
|
3
|
-
* Walk all logger files from loggers
|
|
4
|
-
*/
|
|
5
|
-
function walkLoggerFile(loggers) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
* Walk all logger files from loggers
|
|
3
|
+
*/
|
|
4
|
+
export function walkLoggerFile(loggers) {
|
|
5
|
+
const files = [];
|
|
6
|
+
for (const registeredLogger of Object.values(loggers)) {
|
|
7
|
+
for (const transport of registeredLogger.values()) {
|
|
8
|
+
const file = transport.options.file;
|
|
9
|
+
if (file) {
|
|
10
|
+
files.push(file);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return files;
|
|
12
15
|
}
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
export { walkLoggerFile };
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbGliL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1BOztHQUVHO0FBQ0gsTUFBTSxVQUFVLGNBQWMsQ0FBQyxPQUFxRDtJQUNsRixNQUFNLEtBQUssR0FBYSxFQUFFLENBQUM7SUFDM0IsS0FBSyxNQUFNLGdCQUFnQixJQUFJLE1BQU0sQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQztRQUN0RCxLQUFLLE1BQU0sU0FBUyxJQUFJLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxFQUFFLENBQUM7WUFDbEQsTUFBTSxJQUFJLEdBQUcsU0FBUyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUM7WUFDcEMsSUFBSSxJQUFJLEVBQUUsQ0FBQztnQkFDVCxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQ25CLENBQUM7UUFDSCxDQUFDO0lBQ0gsQ0FBQztJQUNELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQyJ9
|
package/dist/types.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/types.d.ts
|
|
1
|
+
import type { LogrotatorConfig } from './config/config.default.ts';
|
|
2
|
+
import type { LogRotator } from './lib/rotator.ts';
|
|
5
3
|
declare module 'egg' {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
4
|
+
interface EggAppConfig {
|
|
5
|
+
/**
|
|
6
|
+
* logrotator options
|
|
7
|
+
* @member Config#logrotator
|
|
8
|
+
*/
|
|
9
|
+
logrotator: LogrotatorConfig;
|
|
10
|
+
}
|
|
11
|
+
interface Agent {
|
|
12
|
+
LogRotator: typeof LogRotator;
|
|
13
|
+
}
|
|
14
|
+
interface Application {
|
|
15
|
+
LogRotator: typeof LogRotator;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/logrotator",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.21",
|
|
4
4
|
"description": "logrotator for egg",
|
|
5
5
|
"eggPlugin": {
|
|
6
6
|
"name": "logrotator",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"utility": "^2.5.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"egg": "4.1.0-beta.
|
|
61
|
+
"egg": "4.1.0-beta.21"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/node": "^24.6.2",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"tsdown": "^0.15.4",
|
|
68
68
|
"typescript": "^5.9.3",
|
|
69
69
|
"vitest": "4.0.0-beta.16",
|
|
70
|
-
"@eggjs/mock": "7.0.0-beta.
|
|
71
|
-
"@eggjs/schedule": "6.0.0-beta.
|
|
72
|
-
"@eggjs/tsconfig": "3.1.0-beta.
|
|
70
|
+
"@eggjs/mock": "7.0.0-beta.21",
|
|
71
|
+
"@eggjs/schedule": "6.0.0-beta.21",
|
|
72
|
+
"@eggjs/tsconfig": "3.1.0-beta.21"
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
"dist"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"module": "./dist/index.js",
|
|
79
79
|
"types": "./dist/index.d.ts",
|
|
80
80
|
"scripts": {
|
|
81
|
-
"build": "tsdown",
|
|
81
|
+
"build": "tsdown && rimraf dist && tsc -b --clean && tsc",
|
|
82
82
|
"typecheck": "tsc --noEmit",
|
|
83
83
|
"lint": "oxlint --type-aware",
|
|
84
84
|
"test": "vitest run"
|