@contrail/telemetry 2.0.9-alpha-formatting.0 → 2.0.9-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 +3 -6
- package/package.json +1 -1
package/lib/logger/index.js
CHANGED
|
@@ -114,19 +114,16 @@ function createStdoutStream() {
|
|
|
114
114
|
level: 'trace',
|
|
115
115
|
stream: new stream_1.Writable({
|
|
116
116
|
write(chunk, _encoding, callback) {
|
|
117
|
-
var _a
|
|
117
|
+
var _a;
|
|
118
118
|
let line;
|
|
119
119
|
try {
|
|
120
120
|
const logRecord = JSON.parse(chunk.toString());
|
|
121
|
-
const
|
|
122
|
-
const level = (_b = logger_config_1.PINO_LEVEL_TO_NAME[logRecord.level]) !== null && _b !== void 0 ? _b : 'INFO';
|
|
123
|
-
const message = (_c = logRecord[semantic_conventions_2.ATTR_LOG_MESSAGE]) !== null && _c !== void 0 ? _c : '';
|
|
124
|
-
const requestId = (_d = getLambdaRequestId()) !== null && _d !== void 0 ? _d : '-';
|
|
121
|
+
const message = (_a = logRecord[semantic_conventions_2.ATTR_LOG_MESSAGE]) !== null && _a !== void 0 ? _a : '';
|
|
125
122
|
const payload = logRecord[semantic_conventions_2.ATTR_LOG_PAYLOAD];
|
|
126
123
|
const payloadLine = payload && typeof payload === 'object' && Object.keys(payload).length > 0
|
|
127
124
|
? `\n${JSON.stringify(payload, null, 2)}`
|
|
128
125
|
: '';
|
|
129
|
-
line = `${
|
|
126
|
+
line = `${message}${payloadLine}`;
|
|
130
127
|
}
|
|
131
128
|
catch {
|
|
132
129
|
line = chunk.toString().replace(/\n$/, '');
|
package/package.json
CHANGED