@open-norantec/herbal 1.0.2-alpha.4 → 1.0.2-alpha.5

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.
@@ -102,9 +102,6 @@ var ControllerInterceptor = (function () {
102
102
  _.attempt(function () {
103
103
  _this.getLogger().log("[trace:".concat(request === null || request === void 0 ? void 0 : request.traceId, ":response:url] ").concat(request === null || request === void 0 ? void 0 : request.originalUrl));
104
104
  });
105
- _.attempt(function () {
106
- return _this.getLogger().log("[trace:".concat(request === null || request === void 0 ? void 0 : request.traceId, ":request:body] ").concat(JSON.stringify(request === null || request === void 0 ? void 0 : request.body)));
107
- });
108
105
  _.attempt(function () {
109
106
  return _this.getLogger().log("[trace:".concat(request === null || request === void 0 ? void 0 : request.traceId, ":request:headers] ").concat(JSON.stringify(request === null || request === void 0 ? void 0 : request.headers)));
110
107
  });
@@ -229,6 +226,7 @@ function HerbalGuard(options) {
229
226
  else {
230
227
  request.rawBody = null;
231
228
  }
229
+ _.attempt(function () { return _this.getLogger().log("[trace:".concat(request === null || request === void 0 ? void 0 : request.traceId, ":request:body] ").concat(request.rawBody)); });
232
230
  authAdapters = auth_adapter_decorator_1.AuthAdapters.getAdapters((_g = (_f = context === null || context === void 0 ? void 0 : context.getClass) === null || _f === void 0 ? void 0 : _f.call(context)) === null || _g === void 0 ? void 0 : _g.prototype, request.methodName);
233
231
  _m.label = 18;
234
232
  case 18:
@@ -272,6 +270,16 @@ function HerbalGuard(options) {
272
270
  });
273
271
  });
274
272
  };
273
+ HerbalGuardMixin.prototype.getLogger = function () {
274
+ var loggerService = this.ref.get(logger_service_1.LoggerService, { strict: false });
275
+ if (!(loggerService instanceof logger_service_1.LoggerService)) {
276
+ return {
277
+ log: function () { },
278
+ error: function () { },
279
+ };
280
+ }
281
+ return loggerService;
282
+ };
275
283
  HerbalGuardMixin = __decorate([
276
284
  (0, common_2.Injectable)(),
277
285
  __metadata("design:paramtypes", [core_1.ModuleRef])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-norantec/herbal",
3
- "version": "1.0.2-alpha.4",
3
+ "version": "1.0.2-alpha.5",
4
4
  "description": "Herbal is a builder and toolchain for Nest.js applications",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {