zova-module-a-logger 5.1.28 → 5.1.30
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/.metadata/index.d.ts +3 -3
- package/dist/.metadata/index.d.ts.map +1 -1
- package/dist/.metadata/this.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/log.d.ts +1 -1
- package/package.json +2 -2
- package/src/.metadata/index.ts +3 -3
- package/src/.metadata/this.ts +1 -1
- package/src/index.ts +2 -2
- package/src/lib/index.ts +1 -1
- package/src/lib/log.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** aopMethod: begin */
|
|
2
|
-
export * from '../bean/aopMethod.log.
|
|
3
|
-
import { IAopMethodOptionsLog } from '../bean/aopMethod.log.
|
|
2
|
+
export * from '../bean/aopMethod.log.ts';
|
|
3
|
+
import { IAopMethodOptionsLog } from '../bean/aopMethod.log.ts';
|
|
4
4
|
import 'zova-module-a-bean';
|
|
5
5
|
declare module 'zova-module-a-bean' {
|
|
6
6
|
interface IAopMethodRecord {
|
|
@@ -18,7 +18,7 @@ declare module 'zova-module-a-logger' {
|
|
|
18
18
|
}
|
|
19
19
|
/** aopMethod: end */
|
|
20
20
|
/** aopMethod: begin */
|
|
21
|
-
import { AopMethodLog } from '../bean/aopMethod.log.
|
|
21
|
+
import type { AopMethodLog } from '../bean/aopMethod.log.ts';
|
|
22
22
|
import 'zova';
|
|
23
23
|
declare module 'zova' {
|
|
24
24
|
interface IBeanRecordLocal {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/.metadata/index.ts"],"names":[],"mappings":"AACA,uBAAuB;AACvB,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,oBAAoB,CA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AAa;CAAG;AAExD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAiB,gBAAgB;QAC/B,UAAU,EAAE,kBAAkB,CAAC;KAChC;CAOF;AAED,iBAAiB"}
|
package/dist/.metadata/this.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './.metadata/index.
|
|
2
|
-
export * from './lib/index.
|
|
1
|
+
export * from './.metadata/index.ts';
|
|
2
|
+
export * from './lib/index.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,9 @@ import { BeanAopMethodBase, BeanInfo, BeanScopeBase, SymbolBeanFullName, cast }
|
|
|
2
2
|
import { evaluateExpressions } from "@cabloy/utils";
|
|
3
3
|
import { AopMethod, Scope, UseAopMethod } from "zova-module-a-bean";
|
|
4
4
|
//#region src/bean/aopMethod.log.ts
|
|
5
|
-
var _dec$1
|
|
5
|
+
var _dec$1;
|
|
6
|
+
var _dec2$1;
|
|
7
|
+
var _class$1;
|
|
6
8
|
var AopMethodLog = (_dec$1 = AopMethod({ level: "info" }), _dec2$1 = BeanInfo({ module: "a-logger" }), _dec$1(_class$1 = _dec2$1(_class$1 = class AopMethodLog extends BeanAopMethodBase {
|
|
7
9
|
get(options, next, receiver, prop) {
|
|
8
10
|
const context = this._getContext(options, receiver);
|
|
@@ -98,9 +100,9 @@ var AopMethodLog = (_dec$1 = AopMethod({ level: "info" }), _dec2$1 = BeanInfo({
|
|
|
98
100
|
}) || _class$1) || _class$1);
|
|
99
101
|
//#endregion
|
|
100
102
|
//#region src/.metadata/index.ts
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
var
|
|
103
|
+
var _dec;
|
|
104
|
+
var _dec2;
|
|
105
|
+
var _class;
|
|
104
106
|
var ScopeModuleALogger = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-logger" }), _dec(_class = _dec2(_class = class ScopeModuleALogger extends BeanScopeBase {}) || _class) || _class);
|
|
105
107
|
/** scope: end */
|
|
106
108
|
//#endregion
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/bean/aopMethod.log.ts","../src/.metadata/index.ts","../src/lib/log.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { evaluateExpressions } from '@cabloy/utils';\nimport { BeanAopMethodBase, cast, SymbolBeanFullName } from 'zova';\nimport { AopMethod } from 'zova-module-a-bean';\nexport let AopMethodLog = (_dec = AopMethod({\n level: 'info'\n}), _dec2 = __z_BeanInfo({\n module: \"a-logger\"\n}), _dec(_class = _dec2(_class = class AopMethodLog extends BeanAopMethodBase {\n get(options, next, receiver, prop) {\n const context = this._getContext(options, receiver);\n const message = `${receiver[SymbolBeanFullName]}#${prop}(get)`;\n const logger = this.sys.meta.logger.child(options.childName, options.clientName);\n // begin\n const profiler = logger.startTimer();\n // next\n try {\n const res = next();\n this._logResult(profiler, context, res, options, message);\n return res;\n } catch (err) {\n this._logError(profiler, context, err, options, message);\n throw err;\n }\n }\n set(options, value, next, receiver, prop) {\n const context = this._getContext(options, receiver);\n const message = `${receiver[SymbolBeanFullName]}#${prop}(set)`;\n const logger = this.sys.meta.logger.child(options.childName, options.clientName);\n // begin\n const profiler = logger.startTimer();\n // next\n try {\n const res = next();\n this._logValue(profiler, context, value, options, message);\n return res;\n } catch (err) {\n this._logError(profiler, context, err, options, message);\n throw err;\n }\n }\n execute(options, _args, next, receiver, prop) {\n const context = this._getContext(options, receiver);\n const message = `${receiver[SymbolBeanFullName]}#${prop}`;\n const logger = this.sys.meta.logger.child(options.childName, options.clientName);\n // begin\n if (options.args !== false) {\n const info = {\n level: options.level,\n message\n };\n if (context) info.context = context;\n if (_args.length > 0) info.args = _args;\n logger.log(info);\n }\n const profiler = logger.startTimer();\n // next\n try {\n const res = next();\n if (res?.then) {\n return res.then(res => {\n options.result !== false && this._logResult(profiler, context, res, options, message);\n return res;\n }).catch(err => {\n this._logError(profiler, context, err, options, message);\n throw err;\n });\n }\n options.result !== false && this._logResult(profiler, context, res, options, message);\n return res;\n } catch (err) {\n this._logError(profiler, context, err, options, message);\n throw err;\n }\n }\n _getContext(options, receiver) {\n return evaluateExpressions(options.context, {\n self: receiver,\n sys: cast(receiver).sys,\n app: cast(receiver).app,\n ctx: cast(receiver).ctx\n });\n }\n _logValue(profiler, context, value, options, message) {\n const info = {\n level: options.level,\n message\n };\n if (context) info.context = context;\n info.value = value;\n profiler.done(info);\n }\n _logResult(profiler, context, res, options, message) {\n const info = {\n level: options.level,\n message\n };\n if (context) info.context = context;\n if (res !== undefined) info.result = res;\n profiler.done(info);\n }\n _logError(profiler, context, err, _options, message) {\n const info = {\n level: 'error',\n message\n };\n if (context) info.context = context;\n if (err) info.error = err;\n profiler.done(info);\n }\n}) || _class) || _class);","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** aopMethod: begin */\nexport * from '../bean/aopMethod.log.
|
|
1
|
+
{"version":3,"file":"index.js","names":["_dec","_dec2","_class","__z_BeanInfo","__z_BeanInfo"],"sources":["../src/bean/aopMethod.log.ts","../src/.metadata/index.ts","../src/lib/log.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { evaluateExpressions } from '@cabloy/utils';\nimport { BeanAopMethodBase, cast, SymbolBeanFullName } from 'zova';\nimport { AopMethod } from 'zova-module-a-bean';\nexport let AopMethodLog = (_dec = AopMethod({\n level: 'info'\n}), _dec2 = __z_BeanInfo({\n module: \"a-logger\"\n}), _dec(_class = _dec2(_class = class AopMethodLog extends BeanAopMethodBase {\n get(options, next, receiver, prop) {\n const context = this._getContext(options, receiver);\n const message = `${receiver[SymbolBeanFullName]}#${prop}(get)`;\n const logger = this.sys.meta.logger.child(options.childName, options.clientName);\n // begin\n const profiler = logger.startTimer();\n // next\n try {\n const res = next();\n this._logResult(profiler, context, res, options, message);\n return res;\n } catch (err) {\n this._logError(profiler, context, err, options, message);\n throw err;\n }\n }\n set(options, value, next, receiver, prop) {\n const context = this._getContext(options, receiver);\n const message = `${receiver[SymbolBeanFullName]}#${prop}(set)`;\n const logger = this.sys.meta.logger.child(options.childName, options.clientName);\n // begin\n const profiler = logger.startTimer();\n // next\n try {\n const res = next();\n this._logValue(profiler, context, value, options, message);\n return res;\n } catch (err) {\n this._logError(profiler, context, err, options, message);\n throw err;\n }\n }\n execute(options, _args, next, receiver, prop) {\n const context = this._getContext(options, receiver);\n const message = `${receiver[SymbolBeanFullName]}#${prop}`;\n const logger = this.sys.meta.logger.child(options.childName, options.clientName);\n // begin\n if (options.args !== false) {\n const info = {\n level: options.level,\n message\n };\n if (context) info.context = context;\n if (_args.length > 0) info.args = _args;\n logger.log(info);\n }\n const profiler = logger.startTimer();\n // next\n try {\n const res = next();\n if (res?.then) {\n return res.then(res => {\n options.result !== false && this._logResult(profiler, context, res, options, message);\n return res;\n }).catch(err => {\n this._logError(profiler, context, err, options, message);\n throw err;\n });\n }\n options.result !== false && this._logResult(profiler, context, res, options, message);\n return res;\n } catch (err) {\n this._logError(profiler, context, err, options, message);\n throw err;\n }\n }\n _getContext(options, receiver) {\n return evaluateExpressions(options.context, {\n self: receiver,\n sys: cast(receiver).sys,\n app: cast(receiver).app,\n ctx: cast(receiver).ctx\n });\n }\n _logValue(profiler, context, value, options, message) {\n const info = {\n level: options.level,\n message\n };\n if (context) info.context = context;\n info.value = value;\n profiler.done(info);\n }\n _logResult(profiler, context, res, options, message) {\n const info = {\n level: options.level,\n message\n };\n if (context) info.context = context;\n if (res !== undefined) info.result = res;\n profiler.done(info);\n }\n _logError(profiler, context, err, _options, message) {\n const info = {\n level: 'error',\n message\n };\n if (context) info.context = context;\n if (err) info.error = err;\n profiler.done(info);\n }\n}) || _class) || _class);","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** aopMethod: begin */\nexport * from '../bean/aopMethod.log.ts';\nimport 'zova-module-a-bean';\n/** aopMethod: end */\n/** aopMethod: begin */\n\nimport 'zova';\n/** aopMethod: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleALogger = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-logger\"\n}), _dec(_class = _dec2(_class = class ScopeModuleALogger extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */","import { UseAopMethod } from 'zova-module-a-bean';\nexport function Log(options) {\n return UseAopMethod('a-logger:log', options);\n}"],"mappings":";;;;AAAA,IAAIA;AAAMC,IAAAA;AAAOC,IAAAA;AAKjB,IAAW,gBAAgB,SAAO,UAAU,EAC1C,OAAO,OACT,CAAC,GAAG,UAAQC,SAAa,EACvB,QAAQ,WACV,CAAC,GAAGH,OAAK,WAASC,QAAM,WAAS,MAAM,qBAAqB,kBAAkB;CAC5E,IAAI,SAAS,MAAM,UAAU,MAAM;EACjC,MAAM,UAAU,KAAK,YAAY,SAAS,QAAQ;EAClD,MAAM,UAAU,GAAG,SAAS,oBAAoB,GAAG,KAAK;EAGxD,MAAM,WAFS,KAAK,IAAI,KAAK,OAAO,MAAM,QAAQ,WAAW,QAAQ,UAEpD,CAAA,CAAO,WAAW;EAEnC,IAAI;GACF,MAAM,MAAM,KAAK;GACjB,KAAK,WAAW,UAAU,SAAS,KAAK,SAAS,OAAO;GACxD,OAAO;EACT,SAAS,KAAK;GACZ,KAAK,UAAU,UAAU,SAAS,KAAK,SAAS,OAAO;GACvD,MAAM;EACR;CACF;CACA,IAAI,SAAS,OAAO,MAAM,UAAU,MAAM;EACxC,MAAM,UAAU,KAAK,YAAY,SAAS,QAAQ;EAClD,MAAM,UAAU,GAAG,S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K,KAAK,QAAQ,CAAC,CAAC;GACpB,KAAK,KAAK,QAAQ,CAAC,CAAC;GACpB,KAAK,KAAK,QAAQ,CAAC,CAAC;EACtB,CAAC;CACH;CACA,UAAU,UAAU,SAAS,OAAO,SAAS,SAAS;EACpD,MAAM,OAAO;GACX,OAAO,QAAQ;GACf;EACF;EACA,IAAI,SAAS,KAAK,UAAU;EAC5B,KAAK,QAAQ;EACb,SAAS,KAAK,IAAI;CACpB;CACA,WAAW,UAAU,SAAS,KAAK,SAAS,SAAS;EACnD,MAAM,OAAO;GACX,OAAO,QAAQ;GACf;EACF;EACA,IAAI,SAAS,KAAK,UAAU;EAC5B,IAAI,QAAQ,KAAA,GAAW,KAAK,SAAS;EACrC,SAAS,KAAK,IAAI;CACpB;CACA,UAAU,UAAU,SAAS,KAAK,UAAU,SAAS;EACnD,MAAM,OAAO;GACX,OAAO;GACP;EACF;EACA,IAAI,SAAS,KAAK,UAAU;EAC5B,IAAI,KAAK,KAAK,QAAQ;EACtB,SAAS,KAAK,IAAI;CACpB;AACF,CAAC,KAAKC,QAAM,KAAKA;;;AC/GjB,IAAI;AAAM,IAAA;AAAO,IAAA;AAcjB,IAAW,sBAAsB,OAAO,MAAM,GAAG,QAAQE,SAAa,EACpE,QAAQ,WACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,2BAA2B,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK;;;;ACflG,SAAgB,IAAI,SAAS;CAC3B,OAAO,aAAa,gBAAgB,OAAO;AAC7C"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './log.
|
|
1
|
+
export * from './log.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/log.d.ts
CHANGED
package/package.json
CHANGED
package/src/.metadata/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable
|
|
2
2
|
/** aopMethod: begin */
|
|
3
|
-
export * from '../bean/aopMethod.log.
|
|
4
|
-
import { IAopMethodOptionsLog } from '../bean/aopMethod.log.
|
|
3
|
+
export * from '../bean/aopMethod.log.ts';
|
|
4
|
+
import { IAopMethodOptionsLog } from '../bean/aopMethod.log.ts';
|
|
5
5
|
import 'zova-module-a-bean';
|
|
6
6
|
declare module 'zova-module-a-bean' {
|
|
7
7
|
|
|
@@ -26,7 +26,7 @@ declare module 'zova-module-a-logger' {
|
|
|
26
26
|
}
|
|
27
27
|
/** aopMethod: end */
|
|
28
28
|
/** aopMethod: begin */
|
|
29
|
-
import { AopMethodLog } from '../bean/aopMethod.log.
|
|
29
|
+
import type { AopMethodLog } from '../bean/aopMethod.log.ts';
|
|
30
30
|
import 'zova';
|
|
31
31
|
declare module 'zova' {
|
|
32
32
|
export interface IBeanRecordLocal {
|
package/src/.metadata/this.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const __ThisModule__ = 'a-logger';
|
|
2
|
-
export { ScopeModuleALogger as ScopeModule } from './index.
|
|
2
|
+
export { ScopeModuleALogger as ScopeModule } from './index.ts';
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './.metadata/index.
|
|
2
|
-
export * from './lib/index.
|
|
1
|
+
export * from './.metadata/index.ts';
|
|
2
|
+
export * from './lib/index.ts';
|
package/src/lib/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './log.
|
|
1
|
+
export * from './log.ts';
|
package/src/lib/log.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseAopMethod } from 'zova-module-a-bean';
|
|
2
2
|
|
|
3
|
-
import type { IAopMethodOptionsLog } from '../bean/aopMethod.log.
|
|
3
|
+
import type { IAopMethodOptionsLog } from '../bean/aopMethod.log.ts';
|
|
4
4
|
|
|
5
5
|
export function Log(options?: Partial<IAopMethodOptionsLog>): MethodDecorator {
|
|
6
6
|
return UseAopMethod('a-logger:log', options);
|