zova-module-a-logger 5.1.23 → 5.1.27
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.js.map +1 -1
- package/package.json +4 -4
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":["
|
|
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.js';\nimport 'zova-module-a-bean';\n/** aopMethod: end */\n/** aopMethod: begin */\nimport { AopMethodLog } from '../bean/aopMethod.log.js';\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(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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,KAAK,QAAM,KAAK;;;;;AC/GjB,IAAI,MAAM,OAAO;AAcjB,IAAW,sBAAsB,OAAO,MAAM,GAAG,QAAQ,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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-logger",
|
|
3
|
-
"version": "5.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "5.1.27",
|
|
4
|
+
"gitHead": "75a09e6a22891e958802ee649ed454db38f90c16",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Zova Module"
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
28
28
|
"prepublishOnly": "npm run tsc:publish",
|
|
29
29
|
"prepack": "clean-package",
|
|
30
|
-
"postpack": "clean-package restore
|
|
30
|
+
"postpack": "clean-package restore"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@cabloy/logger": "^1.1.
|
|
33
|
+
"@cabloy/logger": "^1.1.25"
|
|
34
34
|
},
|
|
35
35
|
"title": "a-logger",
|
|
36
36
|
"zovaModule": {
|