@midwayjs/core 3.14.4 → 3.14.12
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/baseFramework.js
CHANGED
|
@@ -92,28 +92,24 @@ class BaseFramework {
|
|
|
92
92
|
return this.app;
|
|
93
93
|
}
|
|
94
94
|
createContextLogger(ctx, name) {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
if (name && name !== 'appLogger') {
|
|
96
|
+
const appLogger = this.getLogger(name);
|
|
97
97
|
let ctxLoggerCache = ctx.getAttr(constants_1.REQUEST_CTX_LOGGER_CACHE_KEY);
|
|
98
98
|
if (!ctxLoggerCache) {
|
|
99
99
|
ctxLoggerCache = new Map();
|
|
100
100
|
ctx.setAttr(constants_1.REQUEST_CTX_LOGGER_CACHE_KEY, ctxLoggerCache);
|
|
101
101
|
}
|
|
102
|
-
if (!name) {
|
|
103
|
-
name = 'appLogger';
|
|
104
|
-
}
|
|
105
102
|
// if logger exists
|
|
106
103
|
if (ctxLoggerCache.has(name)) {
|
|
107
104
|
return ctxLoggerCache.get(name);
|
|
108
105
|
}
|
|
109
106
|
// create new context logger
|
|
110
|
-
const ctxLogger = this.loggerService.createContextLogger(ctx, appLogger
|
|
111
|
-
contextFormat: this.contextLoggerFormat,
|
|
112
|
-
});
|
|
107
|
+
const ctxLogger = this.loggerService.createContextLogger(ctx, appLogger);
|
|
113
108
|
ctxLoggerCache.set(name, ctxLogger);
|
|
114
109
|
return ctxLogger;
|
|
115
110
|
}
|
|
116
111
|
else {
|
|
112
|
+
const appLogger = this.getLogger(name !== null && name !== void 0 ? name : this.contextLoggerApplyLogger);
|
|
117
113
|
// avoid maximum call stack size exceeded
|
|
118
114
|
if (ctx['_logger']) {
|
|
119
115
|
return ctx['_logger'];
|
|
@@ -28,7 +28,7 @@ export declare class DefaultConsoleLoggerFactory implements LoggerFactory<ILogge
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
createContextLogger(ctx: any, appLogger: ILogger): ILogger;
|
|
31
|
+
createContextLogger(ctx: any, appLogger: ILogger, contextOptions?: any): ILogger;
|
|
32
32
|
getClients(): Map<string, ILogger>;
|
|
33
33
|
getClientKeys(): string[];
|
|
34
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/core",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.12",
|
|
4
4
|
"description": "midway core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@midwayjs/logger": "^3.0.0",
|
|
26
|
-
"koa": "2.
|
|
26
|
+
"koa": "2.15.0",
|
|
27
27
|
"mm": "3.4.0",
|
|
28
28
|
"raw-body": "2.5.2",
|
|
29
|
-
"sinon": "
|
|
29
|
+
"sinon": "17.0.1"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@midwayjs/glob": "^1.0.2",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=12"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "e6b0c2d35c4fb8dc05fe17fbc546a09a0b6c0486"
|
|
46
46
|
}
|