@lark-apaas/nestjs-logger 1.0.18 → 1.0.19-beta.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 +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -9310,6 +9310,9 @@ var BasePinoLogger = class _BasePinoLogger {
|
|
|
9310
9310
|
this.logger[pinoLevel](sanitizedPayload);
|
|
9311
9311
|
}
|
|
9312
9312
|
} else {
|
|
9313
|
+
if ((level === "error" || level === "fatal") && process.env.NESTJS_LOGGER_STDERR_MIRROR !== "off") {
|
|
9314
|
+
mirrorToStderr(level, messageText, payload);
|
|
9315
|
+
}
|
|
9313
9316
|
let finalMessage = messageText;
|
|
9314
9317
|
if (platformModule) {
|
|
9315
9318
|
if (typeof message !== "string") {
|
|
@@ -9459,6 +9462,21 @@ function sanitizeValue(value) {
|
|
|
9459
9462
|
return value;
|
|
9460
9463
|
}
|
|
9461
9464
|
__name(sanitizeValue, "sanitizeValue");
|
|
9465
|
+
function mirrorToStderr(level, message, payload) {
|
|
9466
|
+
try {
|
|
9467
|
+
const line = safeStringify({
|
|
9468
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9469
|
+
level,
|
|
9470
|
+
message: message ?? "",
|
|
9471
|
+
stack: payload.stack,
|
|
9472
|
+
trace_id: payload.trace_id,
|
|
9473
|
+
pid: payload.pid
|
|
9474
|
+
});
|
|
9475
|
+
process.stderr.write(line + "\n");
|
|
9476
|
+
} catch {
|
|
9477
|
+
}
|
|
9478
|
+
}
|
|
9479
|
+
__name(mirrorToStderr, "mirrorToStderr");
|
|
9462
9480
|
|
|
9463
9481
|
// src/module.ts
|
|
9464
9482
|
var import_common4 = require("@nestjs/common");
|