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:
Nick O'Leary
2020-01-17 16:53:01 +00:00
parent 5e7cd79ed9
commit 95a51aafdc
7 changed files with 89 additions and 16 deletions

View File

@@ -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") {