Save logger (#3)

This commit is contained in:
RossCasey 2019-12-17 14:18:58 +00:00 committed by GitHub
parent 9d20cebc08
commit 2762a8eef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);