@midwayjs/bootstrap 3.12.5 → 3.13.0
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/bootstrap.d.ts +3 -2
- package/dist/bootstrap.js +15 -6
- package/package.json +5 -5
package/dist/bootstrap.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IMidwayBootstrapOptions, IMidwayContainer } from '@midwayjs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ILogger } from '@midwayjs/logger';
|
|
3
3
|
export declare class BootstrapStarter {
|
|
4
4
|
protected appDir: string;
|
|
5
5
|
protected baseDir: string;
|
|
@@ -16,8 +16,9 @@ export declare class BootstrapStarter {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class Bootstrap {
|
|
18
18
|
protected static starter: BootstrapStarter;
|
|
19
|
-
protected static logger:
|
|
19
|
+
protected static logger: ILogger;
|
|
20
20
|
protected static configured: boolean;
|
|
21
|
+
protected static bootstrapLoggerFactory: import("@midwayjs/logger").LoggerFactory;
|
|
21
22
|
/**
|
|
22
23
|
* set global configuration for midway
|
|
23
24
|
* @param configuration
|
package/dist/bootstrap.js
CHANGED
|
@@ -41,6 +41,7 @@ class BootstrapStarter {
|
|
|
41
41
|
}
|
|
42
42
|
this.applicationContext = await (0, core_1.initializeGlobalApplicationContext)({
|
|
43
43
|
asyncContextManager: (0, async_hooks_context_manager_1.createContextManager)(),
|
|
44
|
+
loggerFactory: logger_1.loggers,
|
|
44
45
|
...this.globalOptions,
|
|
45
46
|
});
|
|
46
47
|
return this.applicationContext;
|
|
@@ -86,15 +87,22 @@ class Bootstrap {
|
|
|
86
87
|
* @param configuration
|
|
87
88
|
*/
|
|
88
89
|
static configure(configuration = {}) {
|
|
89
|
-
var _a;
|
|
90
90
|
this.configured = true;
|
|
91
91
|
if (!this.logger && !configuration.logger) {
|
|
92
|
-
this.logger =
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
this.logger = this.bootstrapLoggerFactory.createLogger('bootstrap', {
|
|
93
|
+
enableError: false,
|
|
94
|
+
enableFile: false,
|
|
95
|
+
enableConsole: true,
|
|
95
96
|
});
|
|
96
97
|
if (configuration.logger === false) {
|
|
97
|
-
(
|
|
98
|
+
if (this.logger['disableConsole']) {
|
|
99
|
+
// v2
|
|
100
|
+
this.logger['disableConsole']();
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// v3
|
|
104
|
+
this.logger['level'] = 'none';
|
|
105
|
+
}
|
|
98
106
|
}
|
|
99
107
|
configuration.logger = this.logger;
|
|
100
108
|
}
|
|
@@ -153,7 +161,7 @@ class Bootstrap {
|
|
|
153
161
|
static reset() {
|
|
154
162
|
this.configured = false;
|
|
155
163
|
this.starter = null;
|
|
156
|
-
this.
|
|
164
|
+
this.bootstrapLoggerFactory.close();
|
|
157
165
|
}
|
|
158
166
|
/**
|
|
159
167
|
* on bootstrap receive a exit signal
|
|
@@ -212,4 +220,5 @@ class Bootstrap {
|
|
|
212
220
|
}
|
|
213
221
|
exports.Bootstrap = Bootstrap;
|
|
214
222
|
Bootstrap.configured = false;
|
|
223
|
+
Bootstrap.bootstrapLoggerFactory = new logger_1.MidwayLoggerContainer();
|
|
215
224
|
//# sourceMappingURL=bootstrap.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/bootstrap",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "midwayjs bootstrap",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@midwayjs/async-hooks-context-manager": "^3.
|
|
24
|
+
"@midwayjs/async-hooks-context-manager": "^3.13.0",
|
|
25
25
|
"@midwayjs/event-bus": "1.9.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@midwayjs/core": "^3.
|
|
29
|
-
"@midwayjs/logger": "^
|
|
28
|
+
"@midwayjs/core": "^3.13.0",
|
|
29
|
+
"@midwayjs/logger": "^3.0.0",
|
|
30
30
|
"request": "2.88.2",
|
|
31
31
|
"socket.io-client": "4.7.2"
|
|
32
32
|
},
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=12.11.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9f55734afa5b08dcf46bc89493ec8edaa8c6202b"
|
|
42
42
|
}
|