Closed Daemach closed 5 years ago
Hi @Daemach,
I'm pretty sure there other libraries to handle log with level and format strings. Have you checked?
With ArduinoTrace and StreamUtils, I took a different approach where logging is only used as a debugging tool and removed before production.
Best Regards, Benoit
I haven't been able to find anything that does everything that I need. I guess I'll keep looking.
I'm working on an ESP32 project now where the devices must log offline data locally (to SPIFFS and/or SD) as well as debugging information. My solution is not elegant, but it does work. I have a debug function that you can pass a string to and it will send the results to both the serial port and the SD card. It works, but it's clumsy and not robust. I also have uploads working, so debug files get posted as a multipart form to a web server automatically daily or whenever wifi becomes available. My methods aren't elegant but they seem to be reliable.
I've always wanted something that can take a printf statement and send the data to serial, SD, SPIFFS and/or a webserver (remote logging). Even better would be the ability to pass it a "debug level" info, warning, error, etc., and control the level of logging by passing it a flag from the server in a json config file.
I don't know if you're interested in helping with something like this, but I'll happily offer any and all of my working code to use as a starting point if you can. Here's what I would like to see: