From 2762a8eef655f8a192b43ced0fc675f81bc32c38 Mon Sep 17 00:00:00 2001 From: RossCasey Date: Tue, 17 Dec 2019 14:18:58 +0000 Subject: [PATCH] Save logger (#3) --- nodes/core/core/80-function.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nodes/core/core/80-function.js b/nodes/core/core/80-function.js index 8235baae1..ae0b3e6aa 100644 --- a/nodes/core/core/80-function.js +++ b/nodes/core/core/80-function.js @@ -218,6 +218,7 @@ module.exports = function(RED) { try { var start = process.hrtime(); sandbox.msg = msg; + const logger = msg.logger; const vm2Instance = new vm2.VM({ sandbox }); const result = JSON.parse(vm2Instance.run(functionText)); @@ -227,6 +228,7 @@ module.exports = function(RED) { throw error; } + result.result.logger = logger; sendResults(this,msg._msgid, result.result); var duration = process.hrtime(start);