mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Nodes log via parent flow to allow flow-info to be added
This commit is contained in:
committed by
Nick O'Leary
parent
9a660f3fe9
commit
0c9fd25d3e
@@ -93,7 +93,7 @@ class Flow {
|
||||
* @param {[type]} msg [description]
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
log(msg) {
|
||||
info(msg) {
|
||||
Log.log({
|
||||
id: this.id||"global",
|
||||
level: Log.INFO,
|
||||
@@ -116,6 +116,17 @@ class Flow {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* [log description]
|
||||
* @param {[type]} msg [description]
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
log(msg) {
|
||||
if (!msg.path) {
|
||||
msg.path = this.path;
|
||||
}
|
||||
this.parent.log(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start this flow.
|
||||
|
@@ -698,7 +698,8 @@ const flowAPI = {
|
||||
getNode: getNode,
|
||||
handleError: () => false,
|
||||
handleStatus: () => false,
|
||||
getSetting: k => flowUtil.getEnvVar(k)
|
||||
getSetting: k => flowUtil.getEnvVar(k),
|
||||
log: m => log.log(m)
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user