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:
@@ -53,6 +53,7 @@ class Flow {
|
||||
this.subflowInstanceNodes = {};
|
||||
this.catchNodes = [];
|
||||
this.statusNodes = [];
|
||||
this.path = this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +121,7 @@ class Flow {
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
start(diff) {
|
||||
this.trace("start "+this.TYPE);
|
||||
this.trace("start "+this.TYPE+" ["+this.path+"]");
|
||||
var node;
|
||||
var newNode;
|
||||
var id;
|
||||
@@ -234,7 +235,7 @@ class Flow {
|
||||
for (id in this.activeNodes) {
|
||||
if (this.activeNodes.hasOwnProperty(id)) {
|
||||
node = this.activeNodes[id];
|
||||
this.trace(" "+id.padEnd(16)+" | "+node.type.padEnd(12)+" | "+(node._alias||""));
|
||||
this.trace(" "+id.padEnd(16)+" | "+node.type.padEnd(12)+" | "+(node._alias||"")+(node._zAlias?" [zAlias:"+node._zAlias+"]":""));
|
||||
if (node.type === "catch") {
|
||||
this.catchNodes.push(node);
|
||||
} else if (node.type === "status") {
|
||||
|
Reference in New Issue
Block a user