@lark-apaas/nestjs-logger 1.0.2-alpha.34 → 1.0.2-alpha.36

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 CHANGED
@@ -9558,15 +9558,15 @@ url=${req.url}`, "HTTPTraceInterceptor");
9558
9558
  url: fullUrl,
9559
9559
  duration_ms: durationMs,
9560
9560
  request_body: req.body ?? {},
9561
- response: responseMeta["response_body"] ?? {},
9562
9561
  error_message: isError ? finalResponseBody?.message ?? "" : ""
9563
9562
  };
9564
- const reportData = JSON.stringify(responseData);
9565
- if (process.env.NODE_ENV === "runtime") {
9566
- appLog(reportData, {
9567
- source_type: "platform"
9568
- }, "HTTPTraceInterceptor");
9563
+ if (isJsonResponse) {
9564
+ responseData.response = JSON.parse(finalResponseBody);
9569
9565
  }
9566
+ const reportData = JSON.stringify(responseData);
9567
+ appLog(reportData, {
9568
+ source_type: "platform"
9569
+ }, "HTTPTraceInterceptor");
9570
9570
  this.traceLogger.logStructured(traceLevel, isError ? "HTTP request failed" : "HTTP request completed", responseMeta, "HTTPTraceInterceptor");
9571
9571
  });
9572
9572
  return next.handle().pipe((0, import_operators.catchError)((error) => {