How to save logs in a Processing web app using processing.js?

I am building a simulation of a microwave web app for my thesis. I found out that with Processing was exactly what I was looking for and with the processing.js it is possible to run it in a web page that I’ll use to share the simulation and get user logs.

The main task I have to do is save logs of user actions made on this simulated microwave. Unluckily the commands useful for writing:

  • [createWriter()
  • [p5.PrintWriter]
  • [save()]
  • [saveJSON()](
  • [saveStrings()]
  • [saveTable()]

Just save the output file for the user, while I need to save it where the web app is running (in my case GitHub Pages).

I am sure I am using it correctly since locally everything is ok, but maybe something changes in the web. While the program si running i have the logs into a string, so any other method might be ok too.

Any suggestions or tips about how to fix it or about any different way of how to collect those logs are accepted.

I really appreciate your help, thank you.

1 Like

possibly there is some miss understanding,
script from processing .js and p5.js might be
stored at some ( remote or local ) server
but they not run there ( as server side code )
your browser downloads them and they run on your computer
in the RAM and can create files there too.

and when that script ask you to store the file on your local computer file system
it feels for you like a download ( from server to client ) but it is not,
just from your local RAM to your local drive.

anyhow unless having

  • server-side code and
  • server-side file system declared and
  • GET PUT communication

all will be local.

you can save that file local, upload it later
and use them in the next ( or changed ) script.

also

might give you a idea what could be possible.

1 Like

You have many options, but a common and we’ll-documented one with some good tutorials is to use socket.io and a server side component for logging.