diff --git a/nodes/core/core/58-debug.html b/nodes/core/core/58-debug.html index 093bf1f76..5349ce82d 100644 --- a/nodes/core/core/58-debug.html +++ b/nodes/core/core/58-debug.html @@ -196,8 +196,14 @@ ''; // NOTE: relying on function error to have a "type" that all other msgs don't if (o.hasOwnProperty("type") && (o.type === "function")) { - msg.className = 'debug-message debug-message-level-20'; - msg.innerHTML += '[function] : (error)'; + var errorLvlType = 'error'; + var errorLvl = 20; + if (o.hasOwnProperty("level") && o.level === 30) { + errorLvl = 30; + errorLvlType = 'warn' + } + msg.className = 'debug-message debug-message-level-' + errorLvl; + msg.innerHTML += '[function] : (' + errorLvlType + ')'; } else { msg.innerHTML += ''+(o.topic?topic+' : ':'')+ (o.property?'[msg.'+property+']':'[msg]')+" : "+typ+''; diff --git a/nodes/core/core/80-function.html b/nodes/core/core/80-function.html index cef0809d8..f581574ac 100644 --- a/nodes/core/core/80-function.html +++ b/nodes/core/core/80-function.html @@ -39,6 +39,13 @@

The message is passed in as a JavaScript object called msg.

By convention it will have a msg.payload property containing the body of the message.

+

If your node need to log anything use the node object: +

+

The function should return the messages it wants to pass on to the next nodes in the flow. It can return: