@lark-apaas/nestjs-logger 0.1.0-alpha.4 → 0.1.0-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.
- package/dist/index.cjs +3 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14830,11 +14830,7 @@ var LoggingInterceptor = class {
|
|
|
14830
14830
|
duration_ms: durationMs
|
|
14831
14831
|
};
|
|
14832
14832
|
if (this.config.logResponseBody && responseData !== void 0) {
|
|
14833
|
-
|
|
14834
|
-
const isJsonResponse = this.isJsonContentType(contentType);
|
|
14835
|
-
if (isJsonResponse) {
|
|
14836
|
-
responseMeta["response_body"] = this.sanitizeAndTruncate(responseData);
|
|
14837
|
-
}
|
|
14833
|
+
responseMeta["response_body"] = this.sanitizeAndTruncate(responseData);
|
|
14838
14834
|
}
|
|
14839
14835
|
this.traceLogger.logStructured("verbose", "HTTP request completed", responseMeta, "HTTPTraceInterceptor");
|
|
14840
14836
|
}), (0, import_operators.catchError)((error) => {
|
|
@@ -14887,21 +14883,12 @@ var LoggingInterceptor = class {
|
|
|
14887
14883
|
} catch (error) {
|
|
14888
14884
|
return {
|
|
14889
14885
|
_error: "Failed to serialize data",
|
|
14890
|
-
|
|
14886
|
+
_type: typeof data,
|
|
14887
|
+
_constructor: data?.constructor?.name
|
|
14891
14888
|
};
|
|
14892
14889
|
}
|
|
14893
14890
|
}
|
|
14894
14891
|
/**
|
|
14895
|
-
* 判断是否是 JSON 响应类型
|
|
14896
|
-
*/
|
|
14897
|
-
isJsonContentType(contentType) {
|
|
14898
|
-
if (typeof contentType !== "string") {
|
|
14899
|
-
return false;
|
|
14900
|
-
}
|
|
14901
|
-
const contentTypeLower = contentType.toLowerCase();
|
|
14902
|
-
return contentTypeLower.includes("application/json");
|
|
14903
|
-
}
|
|
14904
|
-
/**
|
|
14905
14892
|
* 脱敏敏感字段
|
|
14906
14893
|
*/
|
|
14907
14894
|
maskSensitiveFields(data) {
|