Is there, or can an option be added, to persist the console log in p5js after stopping a program. It would greatly help with debugging.
Not sure, but perhaps you can play around with
noLoop() to prevent the console log from constantly adding new data
Using noLoop() would help but it would still be nice if there was an option to persist the console after the program is ended.
In what environment do you run the program? editor.p5js or from within a ‘plain’ HTML file? I like the p5js editor for small things, but visual studio code with the proper extensions and all standard browser console and debug capabilities easily surpass it feature wise for a bit more serious efforts.
Thanks for the suggestion. I am using the editor.p5js. I am evaluating p5js to see if I could use it in a coding course for children I teach and was having an issue with a bouncing ball program I was creating. I added some console.log lines to help debug the issue but when I stopped the execution the console was clearing so I just thought the ability to persist it would be nice.
is this correct that you talk about the
online editor environment?
because p5.js sketch in a browser ( from a server environment )
does not have a STOP ( can close the browser window )
yes, right, the online editor console is cleared on [STOP] exit()…
and that might be a interesting feature request.
but also a big problem might be that
if use fullscreen, your code gets stuck and need to hit the [ESC]
so while development the many
print("function name: variable name "+variable);
can help but only if you see it, so
better develop with a canvas 800x800
if some p5.js expert know how to supersede the exit()
in a way that a log file can be “downloaded” saved first
you could write your log into a file.
but i have no idea how to do that.
i think some more support in this direction
for development is a good idea,
but possibly wait and lets check out the 1.0.x
if it comes also with a new editor revision??
BUT for now there is a other way
so, while the console window in online editor is cleared already ( do a [RUN] [STOP] )
i still see the “history” in the inspect CONSOLE
! but only if i open that first!
If you have not done so already, you could submit this as a feature request via “Issues”: