我不想使用调试节点。相反,我只想将调试消息直接从我的自定义节点传递到调试选项卡。所以我想知道是否有一种方法可以用来实现这一目标。
node
node.warn()
node.error()
node.warn(msg.payload); return msg;
请注意,node.error 还会引发一条可由 Catch 节点捕获的消息,因此如果您只想在函数中报告状态,那么
node.warn
您可以使用节点的上下文存储。
在节点开始:
if(context.get("errors") === undefined) { context.set("errors", [])
}
在节点的功能中:
context.get('errors').push({ status: 'err', message: 'There is an error', ts: new Date(), details: { no: '001' }
})