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.
@@ -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): unknown;
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, receiver);
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)}` : '';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-logger",
3
3
  "type": "module",
4
- "version": "5.0.12",
4
+ "version": "5.0.15",
5
5
  "title": "a-logger",
6
6
  "vonaModule": {
7
7
  "dependencies": {}