mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add path property to debug messages
Fixes #2358 This property can be used to identify the full path to the node that logged a given message. If the node is inside a subflow (and maybe nested many levels deep), this path can be used to help find the node, rather than just the top-level subflow instance node. A side-effect of this change is the Debug sidebar is now able to show the message tools for a message coming from a deeply nested subflow
This commit is contained in:
@@ -88,7 +88,7 @@ class Subflow extends Flow {
|
||||
* @param {[type]} subflowInstance [description]
|
||||
*/
|
||||
constructor(parent,globalFlow,subflowDef,subflowInstance) {
|
||||
// console.log("CREATE SUBFLOW",subflowDef.id,subflowInstance.id);
|
||||
// console.log("CREATE SUBFLOW",subflowDef.id,subflowInstance.id,"alias?",subflowInstance._alias);
|
||||
// console.log("SubflowInstance\n"+JSON.stringify(subflowInstance," ",2));
|
||||
// console.log("SubflowDef\n"+JSON.stringify(subflowDef," ",2));
|
||||
var subflows = parent.flow.subflows;
|
||||
@@ -140,6 +140,7 @@ class Subflow extends Flow {
|
||||
this.subflowDef = subflowDef;
|
||||
this.subflowInstance = subflowInstance;
|
||||
this.node_map = node_map;
|
||||
this.path = parent.path+"/"+(subflowInstance._alias||subflowInstance.id);
|
||||
|
||||
var env = [];
|
||||
if (this.subflowDef.env) {
|
||||
@@ -451,7 +452,7 @@ class Subflow extends Flow {
|
||||
function createNodeInSubflow(subflowInstanceId, def) {
|
||||
let node = clone(def);
|
||||
let nid = redUtil.generateId();
|
||||
// console.log("Create Node In subflow",node.id, "--->",nid, "(",node.type,")")
|
||||
// console.log("Create Node In subflow",node._alias, "--->",nid, "(",node.type,")")
|
||||
// node_map[node.id] = node;
|
||||
node._alias = node.id;
|
||||
node.id = nid;
|
||||
|
||||
Reference in New Issue
Block a user