vona-module-a-logger 5.0.12 → 5.0.15
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/bean/aopMethod.log.d.ts +1 -1
- package/dist/index.js +6 -2
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ export declare class AopMethodLog extends BeanAopMethodBase implements IAopMetho
|
|
|
15
15
|
get(options: IAopMethodOptionsLog, next: NextSync, receiver: any, prop: string): any;
|
|
16
16
|
set(options: IAopMethodOptionsLog, value: any, next: NextSync, receiver: any, prop: string): boolean;
|
|
17
17
|
execute(options: IAopMethodOptionsLog, _args: [], next: Next | NextSync, receiver: any, prop: string): Promise<any> | any;
|
|
18
|
-
_getContext(options: IAopMethodOptionsLog, receiver: any):
|
|
18
|
+
_getContext(options: IAopMethodOptionsLog, receiver: any): any;
|
|
19
19
|
_logResult(profiler: winston.Profiler, context: any, res: any, options: IAopMethodOptionsLog, message: string): void;
|
|
20
20
|
_logError(profiler: winston.Profiler, context: any, err: Error, _options: IAopMethodOptionsLog, message: string): void;
|
|
21
21
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BeanInfo, BeanBase, BeanAopMethodBase, SymbolBeanFullName, BeanScopeBase } from 'vona';
|
|
1
|
+
import { BeanInfo, BeanBase, BeanAopMethodBase, SymbolBeanFullName, cast, BeanScopeBase } from 'vona';
|
|
2
2
|
import StdSerializers from 'pino-std-serializers';
|
|
3
3
|
import { MiddlewareSystem, AopMethod, Aspect } from 'vona-module-a-aspect';
|
|
4
4
|
import { evaluateExpressions } from '@cabloy/utils';
|
|
@@ -103,7 +103,11 @@ let AopMethodLog = (_dec$3 = AopMethod({
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
_getContext(options, receiver) {
|
|
106
|
-
return evaluateExpressions(options.context,
|
|
106
|
+
return evaluateExpressions(options.context, {
|
|
107
|
+
self: receiver,
|
|
108
|
+
app: cast(receiver).app,
|
|
109
|
+
ctx: cast(receiver).ctx
|
|
110
|
+
});
|
|
107
111
|
}
|
|
108
112
|
_logResult(profiler, context, res, options, message) {
|
|
109
113
|
const textResult = res !== undefined ? ` result: ${JSON.stringify(res)}` : '';
|