Debug popout - does this already exist?

I was browsing the Share Your Nodes forum today and came across this thread: Flogger - the advanced logging node! - and this post piqued my interest.

I'm not so interested in logging my debugs to files, but having a separate debug dashboard sounds great!

So, I set out to see what it would take to hack it together using what's already available.

I found I could open ./debug/view/view.html in a second window, but it doesn't connect on it's own.

Poking around in the code I found handleDebugMessage() in debug-utils.js

Then I found out I could do RED.comms.subscribe("debug",console.log) in the main UI to get my debugs to the browser console (cool!).

Then I discovered RED.comms.connect(), but it fails with a bogus path.

Next, I set RED.settings.apiRootUrl = "http://myroot.url/" and boom! it connects!

I'm feeling pretty slick at this point but get stuck because subscribe("debug",handleDebugMessage) creates debug messages in my second window but they're all undefined even though the browser console gets the full data.

I take another peek at the GitHub and I see this commit message on lib/debug/debug.js: "Set apiRootUrl for debug pop-out to load locales properly"

...has this already been done? Is there a way to get additional and theoretically limitless debug windows??

Please enlighten me o knowledgeable ones :pray:

1 Like

From the docs...

Note: the Debug sidebar can only show the 100 most recent messages. If the sidebar is currently showing a filtered list of messages, the hidden messages still count towards the 100 limit. If a flow has noisy Debug nodes, rather than filter them from the sidebar it can be better to disable them by clicking their button in the workspace.

The button in the sidebar footer can be used to open a separate browser window containing the Debug sidebar

Yup, there it is, all along.

Thanks for the quick reply!

You could, of course, also output all of your debug messages to the log then use another program to grab and process the log.

What sort of program would do this? Sorry for my ignorance, I'm sure there's lots out there. I was playing with making one but wanted to avoid having to re-invent the code folding (although it doesn't look that bad with jsonView).

I'm actually working on a node to pop open a window just for a specific debug node ...and huzzah!

Just finished this as I'm reading your message.

Link to GitHub repo: https://github.com/mdkrieg/node-red-contrib-debug-specific

2 Likes

If you are putting out to a file as suggested by Julian - then the Tail node is the obvious candidate and some form of input form on it to allow eithr grep (easiest) or regex parameters for filtering the output.

Craig

Coupled with grep or some such to filter things.

Of course, if you are putting stuff into logs, you can use anything that understands text files. This is something that flows through to enterprise monitoring as well so there are hundreds of tools that will work with log files and do monitoring and alerting.

For example:

1 Like

Yep - i was more saying to him that if he wanted to extend his debugging within NR - it would be nice to tail the file into his debug window with some form of configureable parameters for watching it scroll by

Craig

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.