@contrail/telemetry 2.0.8-alpha-formatting.0 → 2.0.8-alpha-formatting.1
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/lib/logger/index.js +6 -1
- package/package.json +1 -1
package/lib/logger/index.js
CHANGED
|
@@ -57,6 +57,11 @@ if (globalRecord[TELEMETRY_SINGLETON_KEY]) {
|
|
|
57
57
|
else {
|
|
58
58
|
globalRecord[TELEMETRY_SINGLETON_KEY] = true;
|
|
59
59
|
}
|
|
60
|
+
// Capture the real console.log before app-framework's hijackConsole() replaces it.
|
|
61
|
+
// This module loads first (as a dependency), so this is always the original.
|
|
62
|
+
// Using it in the stdout stream avoids the infinite loop (hijacked console → pino → console → …)
|
|
63
|
+
// while preserving single-event CloudWatch output (process.stdout.write splits on newlines).
|
|
64
|
+
const originalConsoleLog = console.log;
|
|
60
65
|
// --- Environment & Resource Setup ---
|
|
61
66
|
const semantic_conventions_4 = require("../semantic-conventions");
|
|
62
67
|
const LAMBDA_ENV_OTEL_ATTRIBUTES = getLambdaEnvAttributes();
|
|
@@ -124,7 +129,7 @@ function createStdoutStream() {
|
|
|
124
129
|
catch {
|
|
125
130
|
line = chunk.toString().replace(/\n$/, '');
|
|
126
131
|
}
|
|
127
|
-
|
|
132
|
+
originalConsoleLog(line);
|
|
128
133
|
callback();
|
|
129
134
|
},
|
|
130
135
|
}),
|
package/package.json
CHANGED