diff --git a/functions/log/index.js b/functions/log/index.js index c9e76d49e1..559ae99ea2 100644 --- a/functions/log/index.js +++ b/functions/log/index.js @@ -97,8 +97,7 @@ function getMetrics(callback) { // [START functions_log_stackdriver] exports.processLogEntry = data => { - // Node 6: data.data === Node 8+: data - const dataBuffer = Buffer.from(data.data.data || data.data, 'base64'); + const dataBuffer = Buffer.from(data.data, 'base64'); const logEntry = JSON.parse(dataBuffer.toString('ascii')).protoPayload; console.log(`Method: ${logEntry.methodName}`); diff --git a/functions/log/test/index.test.js b/functions/log/test/index.test.js index 229a2150e0..4ff06ec9e5 100644 --- a/functions/log/test/index.test.js +++ b/functions/log/test/index.test.js @@ -97,9 +97,7 @@ it('processLogEntry: should process log entry', () => { }); const data = { - data: { - data: Buffer.from(json, 'ascii'), - }, + data: Buffer.from(json, 'ascii'), }; sample.program.processLogEntry(data);