esp_log_set_vprintf to write to SPIFFS file
Posted: Thu Jul 13, 2023 3:53 pm
Hello,
I am attempting to write ESP_LOGE messages to a SPIFFS txt file with the use of esp_log_set_vprintf. I am having some success in writing to a my file but for some reason when reading the file my log messages are duplicated
I am writing a total of 5 error log messages and I have a vsprintf function and I'm using fputs(str_buffer) into my file. I am using standard fopen & fclose functions and using the "a" flag with fopen to append to the existing log file in SPIFFS. My log messages always duplicates to 10 log messages when using the "a" flag but when I use the "w" flag I have no issues with writing 5 log messages to SPIFFS. I would like to keep using append so I do not overwrite my the file every time I write a log message to a file. Has anybody tried using the esp_log_set_vprintf before and encountered this issue? Any help would be appreciated.
I am attempting to write ESP_LOGE messages to a SPIFFS txt file with the use of esp_log_set_vprintf. I am having some success in writing to a my file but for some reason when reading the file my log messages are duplicated
I am writing a total of 5 error log messages and I have a vsprintf function and I'm using fputs(str_buffer) into my file. I am using standard fopen & fclose functions and using the "a" flag with fopen to append to the existing log file in SPIFFS. My log messages always duplicates to 10 log messages when using the "a" flag but when I use the "w" flag I have no issues with writing 5 log messages to SPIFFS. I would like to keep using append so I do not overwrite my the file every time I write a log message to a file. Has anybody tried using the esp_log_set_vprintf before and encountered this issue? Any help would be appreciated.