@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.cjs CHANGED
@@ -9575,15 +9575,15 @@ url=${req.url}`, "HTTPTraceInterceptor");
9575
9575
  url: fullUrl,
9576
9576
  duration_ms: durationMs,
9577
9577
  request_body: req.body ?? {},
9578
- response: responseMeta["response_body"] ?? {},
9579
9578
  error_message: isError ? finalResponseBody?.message ?? "" : ""
9580
9579
  };
9581
- const reportData = JSON.stringify(responseData);
9582
- if (process.env.NODE_ENV === "runtime") {
9583
- appLog(reportData, {
9584
- source_type: "platform"
9585
- }, "HTTPTraceInterceptor");
9580
+ if (isJsonResponse) {
9581
+ responseData.response = JSON.parse(finalResponseBody);
9586
9582
  }
9583
+ const reportData = JSON.stringify(responseData);
9584
+ appLog(reportData, {
9585
+ source_type: "platform"
9586
+ }, "HTTPTraceInterceptor");
9587
9587
  this.traceLogger.logStructured(traceLevel, isError ? "HTTP request failed" : "HTTP request completed", responseMeta, "HTTPTraceInterceptor");
9588
9588
  });
9589
9589
  return next.handle().pipe((0, import_operators.catchError)((error) => {