Debugging: values of variables?
Alasdair McAndrew last edited by
As always, many thanks!
@z3dev Hey! Thanks for the reply and the welcome, appreciated. I tried @danmarshall app and it works as I was expected. I tried the console.log with the web + debug console in safari and chrome (on mac) but didn't get anything printed.
It's any other post with other tools for debugging available or it's still in development? (I'm using vsc)
z3dev last edited by
Those messages from console.log() should output to the Console of any of the browsers. Try a simple text message such as console.log(“hi”)
As for debugging designs, the WEB UI uses worker threads for compiling the designs. This keeps the UI responsive while the compile is running. Good for the general users but not for serious designs, as setting break points and interrogating variables becomes almost impossible.
If still interested then @danmarshall has put together a small application that does the compile in the main thread. But you’ll need to download and install the application. See https://github.com/danmarshall/jscad-now
Beforehand, my apologies to revive this old thread, I'm currently developing in the v2 of JSCAD, I tried with console.log on a subpart, which successfully compiles but if I open the console (with Chrome on Mac) i'm not able to see any comment or var printed on screen. I'm missing something?
In a recent post from @z3dev the scope was fixed, I don't know if its related to this, if not, it's any other way to see a log?
gilboonet last edited by
Same here, I only use console.log in Firefox, and I even used it on some scripts to export data before I knew how to use localStorage.
hrgdavor last edited by
I just use console.log in Chrome(mostly prefer ti vs debug ), and I think debug breakpoints are not possible due to way user scripts are loaded (I may be wrong on this one).