@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.cjs
CHANGED
|
@@ -9288,6 +9288,7 @@ var BasePinoLogger = class _BasePinoLogger {
|
|
|
9288
9288
|
const sanitizedPayload = sanitizeValue(payload);
|
|
9289
9289
|
const isTriggerLog = firstParam?.module === "trigger";
|
|
9290
9290
|
const platformModule = isTriggerLog ? "trigger" : firstParam?.paas_attributes_module;
|
|
9291
|
+
const parentSpan = firstParam?.paas_parent_span_context;
|
|
9291
9292
|
if (process.env.NODE_ENV === "development") {
|
|
9292
9293
|
if (platformModule && !isTriggerLog) {
|
|
9293
9294
|
return;
|
|
@@ -9306,13 +9307,13 @@ var BasePinoLogger = class _BasePinoLogger {
|
|
|
9306
9307
|
this.observableService.log(level, finalMessage ?? "", {
|
|
9307
9308
|
...payload,
|
|
9308
9309
|
module: platformModule
|
|
9309
|
-
});
|
|
9310
|
+
}, parentSpan);
|
|
9310
9311
|
} else {
|
|
9311
9312
|
const reportMessage = this.processLogParams([
|
|
9312
9313
|
message,
|
|
9313
9314
|
...optionalParams
|
|
9314
9315
|
]);
|
|
9315
|
-
this.observableService.log(level, reportMessage, {});
|
|
9316
|
+
this.observableService.log(level, reportMessage, {}, parentSpan);
|
|
9316
9317
|
}
|
|
9317
9318
|
}
|
|
9318
9319
|
}
|
|
@@ -9541,7 +9542,7 @@ var LoggingInterceptor = class {
|
|
|
9541
9542
|
method,
|
|
9542
9543
|
path
|
|
9543
9544
|
});
|
|
9544
|
-
const startedAt =
|
|
9545
|
+
const startedAt = process.hrtime();
|
|
9545
9546
|
const baseMeta = {
|
|
9546
9547
|
method,
|
|
9547
9548
|
path,
|
|
@@ -9582,7 +9583,7 @@ url=${req.url}`, "HTTPTraceInterceptor");
|
|
|
9582
9583
|
return;
|
|
9583
9584
|
}
|
|
9584
9585
|
logged = true;
|
|
9585
|
-
const durationMs =
|
|
9586
|
+
const durationMs = process.hrtime(startedAt)[1] / 1e6;
|
|
9586
9587
|
const statusCode = res.statusCode;
|
|
9587
9588
|
const responseMeta = {
|
|
9588
9589
|
...baseMeta,
|
|
@@ -9631,7 +9632,7 @@ duration_ms=${durationMs}`, "HTTPTraceInterceptor");
|
|
|
9631
9632
|
return next.handle().pipe((0, import_operators.tap)({
|
|
9632
9633
|
next: /* @__PURE__ */ __name((data) => {
|
|
9633
9634
|
const statusCode = res.statusCode;
|
|
9634
|
-
const durationMs =
|
|
9635
|
+
const durationMs = process.hrtime(startedAt)[1] / 1e6;
|
|
9635
9636
|
const isError = statusCode > 400;
|
|
9636
9637
|
const responseData = {
|
|
9637
9638
|
method,
|