@lark-apaas/nestjs-logger 1.0.7 → 1.0.9-alpha.0
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 +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -9271,6 +9271,7 @@ var BasePinoLogger = class _BasePinoLogger {
|
|
|
9271
9271
|
const sanitizedPayload = sanitizeValue(payload);
|
|
9272
9272
|
const isTriggerLog = firstParam?.module === "trigger";
|
|
9273
9273
|
const platformModule = isTriggerLog ? "trigger" : firstParam?.paas_attributes_module;
|
|
9274
|
+
const parentSpan = firstParam?.paas_parent_span_context;
|
|
9274
9275
|
if (process.env.NODE_ENV === "development") {
|
|
9275
9276
|
if (platformModule && !isTriggerLog) {
|
|
9276
9277
|
return;
|
|
@@ -9289,13 +9290,13 @@ var BasePinoLogger = class _BasePinoLogger {
|
|
|
9289
9290
|
this.observableService.log(level, finalMessage ?? "", {
|
|
9290
9291
|
...payload,
|
|
9291
9292
|
module: platformModule
|
|
9292
|
-
});
|
|
9293
|
+
}, parentSpan);
|
|
9293
9294
|
} else {
|
|
9294
9295
|
const reportMessage = this.processLogParams([
|
|
9295
9296
|
message,
|
|
9296
9297
|
...optionalParams
|
|
9297
9298
|
]);
|
|
9298
|
-
this.observableService.log(level, reportMessage, {});
|
|
9299
|
+
this.observableService.log(level, reportMessage, {}, parentSpan);
|
|
9299
9300
|
}
|
|
9300
9301
|
}
|
|
9301
9302
|
}
|
|
@@ -9524,7 +9525,7 @@ var LoggingInterceptor = class {
|
|
|
9524
9525
|
method,
|
|
9525
9526
|
path
|
|
9526
9527
|
});
|
|
9527
|
-
const startedAt =
|
|
9528
|
+
const startedAt = process.hrtime();
|
|
9528
9529
|
const baseMeta = {
|
|
9529
9530
|
method,
|
|
9530
9531
|
path,
|
|
@@ -9565,7 +9566,7 @@ url=${req.url}`, "HTTPTraceInterceptor");
|
|
|
9565
9566
|
return;
|
|
9566
9567
|
}
|
|
9567
9568
|
logged = true;
|
|
9568
|
-
const durationMs =
|
|
9569
|
+
const durationMs = process.hrtime(startedAt)[1] / 1e6;
|
|
9569
9570
|
const statusCode = res.statusCode;
|
|
9570
9571
|
const responseMeta = {
|
|
9571
9572
|
...baseMeta,
|
|
@@ -9614,7 +9615,7 @@ duration_ms=${durationMs}`, "HTTPTraceInterceptor");
|
|
|
9614
9615
|
return next.handle().pipe((0, import_operators.tap)({
|
|
9615
9616
|
next: /* @__PURE__ */ __name((data) => {
|
|
9616
9617
|
const statusCode = res.statusCode;
|
|
9617
|
-
const durationMs =
|
|
9618
|
+
const durationMs = process.hrtime(startedAt)[1] / 1e6;
|
|
9618
9619
|
const isError = statusCode > 400;
|
|
9619
9620
|
const responseData = {
|
|
9620
9621
|
method,
|