moost 0.4.23 → 0.5.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/index.cjs +5 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +5 -5
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -385,7 +385,7 @@ function getIterceptorHandlerFactory(interceptors, getTargetInstance, pipes, log
|
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
async function bindControllerMethods(options) {
|
|
388
|
-
const opts = options
|
|
388
|
+
const opts = options;
|
|
389
389
|
const { getInstance } = opts;
|
|
390
390
|
const { classConstructor } = opts;
|
|
391
391
|
const { adapters } = opts;
|
|
@@ -462,7 +462,7 @@ async function bindControllerMethods(options) {
|
|
|
462
462
|
getIterceptorHandler,
|
|
463
463
|
resolveArgs,
|
|
464
464
|
logHandler: (eventName) => {
|
|
465
|
-
options.logger.info(
|
|
465
|
+
options.logger.info(`${eventName} ${'[0m' + '[2m' + '[32m'}→ ${classConstructor.name}.${'[36m'}${method}${'[32m'}()`);
|
|
466
466
|
},
|
|
467
467
|
register(h, path, args) {
|
|
468
468
|
const data = wm.get(h);
|
|
@@ -670,10 +670,10 @@ class Moost extends hookable.Hookable {
|
|
|
670
670
|
this.provide = infact$1.createProvideRegistry([infact$1.Infact, getMoostInfact], [mate$1.Mate, getMoostMate]);
|
|
671
671
|
this.replace = {};
|
|
672
672
|
this.unregisteredControllers = [];
|
|
673
|
-
this.logger = options?.logger || getDefaultLogger('moost
|
|
674
|
-
getMoostInfact().setLogger(this.getLogger('infact'));
|
|
673
|
+
this.logger = options?.logger || getDefaultLogger(`${'[2m' + '[35m'}[moost]`);
|
|
674
|
+
getMoostInfact().setLogger(this.getLogger('[infact]'));
|
|
675
675
|
const mate = getMoostMate();
|
|
676
|
-
Object.assign(mate, { logger: this.getLogger('mate') });
|
|
676
|
+
Object.assign(mate, { logger: this.getLogger('[mate]') });
|
|
677
677
|
}
|
|
678
678
|
_fireEventStart(source) {
|
|
679
679
|
this.callHook('event-start', source);
|
package/dist/index.d.ts
CHANGED
|
@@ -432,7 +432,7 @@ interface TMoostOptions {
|
|
|
432
432
|
* │ const app = new MyServer()
|
|
433
433
|
* │ const http = new MoostHttp()
|
|
434
434
|
* │ app.adapter(http).listen(3000, () => {
|
|
435
|
-
* │ app.getLogger('MyApp').log('Up on port 3000')
|
|
435
|
+
* │ app.getLogger('[MyApp]').log('Up on port 3000')
|
|
436
436
|
* │ })
|
|
437
437
|
* │ app.init()
|
|
438
438
|
* ```
|
|
@@ -480,7 +480,7 @@ declare class Moost extends Hookable {
|
|
|
480
480
|
* Provides application logger
|
|
481
481
|
* ```js
|
|
482
482
|
* // get logger with topic = "App"
|
|
483
|
-
* const logger = app.getLogger('App')
|
|
483
|
+
* const logger = app.getLogger('[App]')
|
|
484
484
|
* logger.log('...')
|
|
485
485
|
* ```
|
|
486
486
|
* @param topic
|
package/dist/index.mjs
CHANGED
|
@@ -386,7 +386,7 @@ function getIterceptorHandlerFactory(interceptors, getTargetInstance, pipes, log
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
async function bindControllerMethods(options) {
|
|
389
|
-
const opts = options
|
|
389
|
+
const opts = options;
|
|
390
390
|
const { getInstance } = opts;
|
|
391
391
|
const { classConstructor } = opts;
|
|
392
392
|
const { adapters } = opts;
|
|
@@ -463,7 +463,7 @@ async function bindControllerMethods(options) {
|
|
|
463
463
|
getIterceptorHandler,
|
|
464
464
|
resolveArgs,
|
|
465
465
|
logHandler: (eventName) => {
|
|
466
|
-
options.logger.info(
|
|
466
|
+
options.logger.info(`${eventName} ${'[0m' + '[2m' + '[32m'}→ ${classConstructor.name}.${'[36m'}${method}${'[32m'}()`);
|
|
467
467
|
},
|
|
468
468
|
register(h, path, args) {
|
|
469
469
|
const data = wm.get(h);
|
|
@@ -671,10 +671,10 @@ class Moost extends Hookable {
|
|
|
671
671
|
this.provide = createProvideRegistry([Infact, getMoostInfact], [Mate, getMoostMate]);
|
|
672
672
|
this.replace = {};
|
|
673
673
|
this.unregisteredControllers = [];
|
|
674
|
-
this.logger = options?.logger || getDefaultLogger('moost
|
|
675
|
-
getMoostInfact().setLogger(this.getLogger('infact'));
|
|
674
|
+
this.logger = options?.logger || getDefaultLogger(`${'[2m' + '[35m'}[moost]`);
|
|
675
|
+
getMoostInfact().setLogger(this.getLogger('[infact]'));
|
|
676
676
|
const mate = getMoostMate();
|
|
677
|
-
Object.assign(mate, { logger: this.getLogger('mate') });
|
|
677
|
+
Object.assign(mate, { logger: this.getLogger('[mate]') });
|
|
678
678
|
}
|
|
679
679
|
_fireEventStart(source) {
|
|
680
680
|
this.callHook('event-start', source);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moost",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "moost",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@prostojs/infact": "^0.2.4",
|
|
35
35
|
"@prostojs/mate": "^0.3.3",
|
|
36
|
-
"@prostojs/logger": "^0.4.
|
|
37
|
-
"@wooksjs/event-core": "^0.5.
|
|
36
|
+
"@prostojs/logger": "^0.4.3",
|
|
37
|
+
"@wooksjs/event-core": "^0.5.18",
|
|
38
38
|
"hookable": "^5.5.3",
|
|
39
|
-
"wooks": "^0.5.
|
|
39
|
+
"wooks": "^0.5.18"
|
|
40
40
|
},
|
|
41
41
|
"author": "Artem Maltsev",
|
|
42
42
|
"license": "MIT",
|