@contrail/telemetry 2.0.6 → 2.0.8-alpha-formatting.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.
@@ -82,7 +82,6 @@ const otelLoggerProvider = new sdk_logs_1.LoggerProvider({
82
82
  });
83
83
  const otelLogger = otelLoggerProvider.getLogger(serviceName);
84
84
  // --- Pino Stream Destinations ---
85
- const stdout_writer_1 = require("./stdout-writer");
86
85
  function isPinoPrettyInstalled() {
87
86
  try {
88
87
  require.resolve('pino-pretty');
@@ -125,7 +124,7 @@ function createStdoutStream() {
125
124
  catch {
126
125
  line = chunk.toString().replace(/\n$/, '');
127
126
  }
128
- stdout_writer_1.stdoutWriter.log(line);
127
+ console.log(line);
129
128
  callback();
130
129
  },
131
130
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/telemetry",
3
- "version": "2.0.6",
3
+ "version": "2.0.8-alpha-formatting.0",
4
4
  "description": "Telemetry and monitoring utilities for contrail services",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -1,6 +0,0 @@
1
- export declare const stdoutWriter: {
2
- log: {
3
- (...data: any[]): void;
4
- (message?: any, ...optionalParams: any[]): void;
5
- };
6
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stdoutWriter = void 0;
4
- // Capture console.log so we can use it from the pino stdout stream.
5
- // Lambda treats each console.log() call as a single CloudWatch log event (even with
6
- // embedded newlines), unlike process.stdout.write() which splits on \n.
7
- //
8
- // Guard: app-framework's hijackConsole() replaces console.log with overridenLog,
9
- // which routes back into pino — using it here would create an infinite loop.
10
- // We detect that specific replacement by name. Any other replacement (e.g. the
11
- // OTel Lambda layer's console patch) is safe to use.
12
- const _capturedConsoleLog = console.log;
13
- const isAppFrameworkHijack = _capturedConsoleLog.name === 'overridenLog';
14
- // Wrapped in an object so tests can jest.spyOn(stdoutWriter, 'log') regardless
15
- // of Jest's console patching strategy (BufferedConsole vs CustomConsole).
16
- exports.stdoutWriter = {
17
- log: isAppFrameworkHijack
18
- ? (...args) => process.stdout.write(args.map(String).join(' ') + '\n')
19
- : _capturedConsoleLog,
20
- };