Debug node improvements

Dear all!
I copiously insert debug nodes into my flows (as well as inject nodes) in order to test my flows in a fine grained, controllable manner.
When running, they provide valuable information right in the flow view, even when the debug output is disabled or the debug window is ... elsewhere.
I often want to count the incoming messages, I often want to see the last time, and, of course, I often want to see real stuff, that is some msg related stuff as node status. Therefore I often have THREE debug nodes. Too many.
I imagine a debug node capable of providing more than one type of information. Optionally, that is.
Perhaps time above left adjusted, a counter adjusted to the right, node status as is right below.
What do you think?
Cheers, Uwe

The time, topic and source node are already shown:

A count can be added to the debug node itself:

So unless I've missed something, I think everything you want is already there?

If you want more things in the output, simply add a node to add additional properties to the msg going to debug.

1 Like

I didn't make myself clear enough:

I'd like to ADD ONE better Debug Node only to my FLOW to see all the information I want in right in the flow at a single glance.

I know that I can see all the information I want wo see using the debug window, using more than one Debug Node.

Don't forget, in a 'function' node you can use node.status to show important things.

node.status({text:"State register = " + fsm_state});

node.status({fill:"green",shape:"dot",text:"Manual mode is ON"});

Yeah, of course I could somehow use a function node "creative" way to provide count, time, and text, even a colourful indication of state.

Perhaps I circumvent current limits of the Debug Node with this. There is one line below and I dont know how long it can be ... For me, this has a touch of "not intended" use of a function node.

However: The question is NOT "Can I achieve what I want somehow with the current state of NR."

My answer would be "Yes, perhaps, somehow, quite, oh, no, if I think about it thoroughly … not really!!!".

My question is "Would it be beneficial to add these capabilities to a new version of the Debug node?" to evolve, improve NR to make it ready for the future.

Do you think it would be useful to have a beefed up Debug node, optionally providing more output possibilities simultaneously, such as count, time, and msg.payload stuff?

There have been a few discussions about potential improvements to flow debugging recently, there will hopefully be several changes before Node-red v5.
I'm not aware of anywhere they are gathered together for discussion, sadly.

Regarding your plan to have three bits of info clustered around the debug node on the editor desktop, I think it's unlikely to be approved by the authorities.

I could imagine a little "More info" tab similar to what is displayed on a node which has something on it's Description tab, or a Comment node with text in the main config panel.
At the expense of having to click the icon this could display much more debug info (in a popup?) than there is space for clustered around the node.

ps At the risk of getting a reply ALL IN CAPITALS, I'll just point out that you can go some way towards your goal with a jsonata expression to set the debug node status, albeit restricted to 32 characters (configurable in settings.js).
For example:

$moment($now()).format("HH:mm:ss") & " " & payload

gives me
image

Jsonata can't easily include a message count though.
In Node-red Jsonata can read a context variable but it can't increment it.

I love this expression. :smiley:

I will wait and see what the bright future will bring us wrt. usability tradeoffs (clicks vs. clutter) & testability.

i would be happy if debug node can print all properties by default (instead of just payload). I have to do multiple clicks to see properties.

You can set the node to Output Complete Message, or do you mean that you want it fully expanded so you don't need to click the objects to expand them?

1 Like

"I think" they mean that the default when you drag on a new node should be complete msg rather than msg.payload...

yes. all properties (complete message object) by default, instead of just payload.

1 Like

The ideal might be an option that one could set in the debug node itself. 'Default debug nodes to this output' or some appropriate wording so that one could easily set the default on the fly. Sometimes one wants one default, and other times something else.

1 Like

Or in settings.js

I want to be able to switch it on the fly. So that when I create or edit a debug node I can set it to Output Complete Message and click the default checkbox, in fact it is a button not a checkbox. Then the next time I create a debug node it will default to that mode. If I edit another one and set it to msg.payload then I can click the button again and further new nodes will default to that.

Ah, I see. Not something that I would want. However, there are a number of nodes that I always end up tweaking and wish that there was a standard feature for doing so. Debug is one - output all and don't show name. Inject is another - output a blank message & don't show name. There are probably others. But these are the most common where I wish I could simply change the defaults for all new instances.

settings set on a node are - per node... so if you add one and ticked a box to set a "default" - it would only apply to that instance... so next one you added would also need setting... (ie where we are today) - work around is of course to cut paste the one you have set...

So would need to be either in settings.js - or in editor settings.

Yes, it wouldn't be a setting on a node, it would be an action performed when you click the button to say what the default would be in future, so a global, variable, setting. I don't know whether there is anything like that at the moment. Possibly not.

Another use case for alias nodes. Perhaps something that could be thought through for official support in NR since they can also be used to create debug nodes that log the entire msg by default.