vona-core 5.0.56 → 5.0.58
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/lib/core/logger.js
CHANGED
|
@@ -7,6 +7,7 @@ import { cast } from "../../types/utils/cast.js";
|
|
|
7
7
|
import { BeanSimple } from "../bean/beanSimple.js";
|
|
8
8
|
import { deepExtend } from "../utils/util.js";
|
|
9
9
|
const SymbolLoggerInstances = Symbol('SymbolLoggerInstances');
|
|
10
|
+
const SymbolLoggerMessage = Symbol('SymbolLoggerMessage');
|
|
10
11
|
export class AppLogger extends BeanSimple {
|
|
11
12
|
[SymbolLoggerInstances] = {};
|
|
12
13
|
async dispose() {
|
|
@@ -127,11 +128,11 @@ export const formatLoggerFilter = Winston.format((info, opts) => {
|
|
|
127
128
|
return false;
|
|
128
129
|
if (opts.strict) {
|
|
129
130
|
if (Winston.config.npm.levels[info.level] === Winston.config.npm.levels[level])
|
|
130
|
-
return info;
|
|
131
|
+
return __formatLoggerFilterCheckInfo(info);
|
|
131
132
|
return false;
|
|
132
133
|
}
|
|
133
134
|
if (Winston.config.npm.levels[info.level] <= Winston.config.npm.levels[level] || (opts.silly && info.level === 'silly'))
|
|
134
|
-
return info;
|
|
135
|
+
return __formatLoggerFilterCheckInfo(info);
|
|
135
136
|
return false;
|
|
136
137
|
});
|
|
137
138
|
export const formatLoggerConsole = () => {
|
|
@@ -145,3 +146,12 @@ export const formatLoggerConsole = () => {
|
|
|
145
146
|
return `${timestamp} ${level}${textName}${textBeanFullName}${textMeta}${textMessage}${textDurationMs}${textStack}`;
|
|
146
147
|
});
|
|
147
148
|
};
|
|
149
|
+
function __formatLoggerFilterCheckInfo(info) {
|
|
150
|
+
if (typeof info.message === 'function') {
|
|
151
|
+
if (info.message[SymbolLoggerMessage] === undefined) {
|
|
152
|
+
info.message[SymbolLoggerMessage] = info.message();
|
|
153
|
+
}
|
|
154
|
+
info.message = info.message[SymbolLoggerMessage];
|
|
155
|
+
}
|
|
156
|
+
return info;
|
|
157
|
+
}
|
|
@@ -20,3 +20,11 @@ export interface ConfigLogger {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export type LoggerLevel = 'error' | 'warn' | 'info' | 'http' | 'verbose' | 'debug' | 'silly';
|
|
23
|
+
declare module 'winston' {
|
|
24
|
+
interface LogMethod {
|
|
25
|
+
(level: string, message: () => string, ...meta: any[]): any;
|
|
26
|
+
}
|
|
27
|
+
interface LeveledLogMethod {
|
|
28
|
+
(message: () => string, ...meta: any[]): any;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.58",
|
|
5
5
|
"description": "vona",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@cabloy/module-info": "^1.3.26",
|
|
33
33
|
"@cabloy/module-info-pro": "^1.0.34",
|
|
34
34
|
"@cabloy/set": "^1.0.17",
|
|
35
|
-
"@cabloy/utils": "^1.0.
|
|
35
|
+
"@cabloy/utils": "^1.0.41",
|
|
36
36
|
"@cabloy/word-utils": "^2.0.1",
|
|
37
37
|
"@cabloy/zod-errors-custom": "^2.0.2",
|
|
38
38
|
"@cabloy/zod-openapi": "^1.0.2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"retry": "^0.13.1",
|
|
46
46
|
"triple-beam": "^1.4.1",
|
|
47
47
|
"uuid": "^11.0.3",
|
|
48
|
-
"winston": "^3.
|
|
48
|
+
"winston": "^3.18.3",
|
|
49
49
|
"winston-daily-rotate-file": "^5.0.0",
|
|
50
50
|
"zod": "^4.1.5"
|
|
51
51
|
},
|