-->
Page 1 of 1

Logging library with message stored

PostPosted: Fri Jan 04, 2019 1:40 pm
by array81
Until now I use Serial.println() function on my project to debug it.
However on my project I use a NodeMCU to create a websever and I have a html page, so I'd like show debug messages inside a textarea then with javascript code I'd like refresh the textarea to upgrade the messages.

Is there a simple library for logging that allow to use Serial.println() but also to save message for using them with my textarea?

There could be problems with memory, but in this case the library would be save only last messages (for example last 30 or 50 messages).

Re: Logging library with message stored

PostPosted: Fri Jan 04, 2019 4:52 pm
by McChubby007
I don't know of one. You could use a ringbuffer or similar to save info, and then just dump it to whatever outut you want. This limits memory usage and also makes normal runtime more 'performant' as you aren't constantly writing (and waiting) for slow output devices (such as serial) or semi-slow like network but instead just output on demand.