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:
@@ -52,7 +52,7 @@ function Node(n) {
|
||||
// the object (such as dashboard) will not like circular refs
|
||||
// The value must still be writable in the case that a node does:
|
||||
// Object.assign(this,config)
|
||||
// as part of its constructure - config._flow will overwrite this._flow
|
||||
// as part of its constructor - config._flow will overwrite this._flow
|
||||
// which we can tolerate as they are the same object.
|
||||
Object.defineProperty(this,'_flow', {value: n._flow, enumerable: false, writable: true })
|
||||
this._asyncDelivery = n._flow.asyncMessageDelivery;
|
||||
@@ -462,6 +462,9 @@ function log_helper(self, level, msg) {
|
||||
if (self._alias) {
|
||||
o._alias = self._alias;
|
||||
}
|
||||
if (self._flow) {
|
||||
o.path = self._flow.path;
|
||||
}
|
||||
if (self.z) {
|
||||
o.z = self.z;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user