I am currently enabling offline functionality, so implemented SYSTEM_THREAD(ENABLED) to run the offline algorithms on the application thread while the system thread deals with attempting to connect back onto WiFi in the background. We are using OS version 1.5.0.
It works well except when using the logHandler class, there are duplicate entries for many of the logs (with same timestamp). I assume this is because both system and application threads are outputting.
Here is an example output log I’m getting:
There are no duplicated messages when printing to Serial (using WITH_LOCK) instead of using Log.
Can someone tell me if there is a way to prevent the duplicated Log entries when using SYSTEM_THREAD(ENABLED)?
Thanks for the quick response. @armor just tried v1.4. with same issue. @rickkas7 here are my log handler calls, this might be the issue but how should we allow both Serial and SD card logging with one call?
Thank you @rickkas7! That works as expected.
For reference by others, I used .withNoSerialLogging() inside the STARTUP function.
On a separate note, is there a way to make the timestamp of the SD card log equal to the current time?
So that if something goes wrong, we can track back to the time it happened.