-
Notifications
You must be signed in to change notification settings - Fork 7.6k
esp_log_set_vprintf doesnt process correctly the log messages from sketch #2021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I see why: |
Hello ! I've been trying to use Did you fix this ? Did you manage to use Thank you ! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
See also #4346 |
I have the same issue, the only solution I have found is to use the esp_log_write to redirect the message |
Hi, I want to redirect the logging to the internal buffer to be available for the webpage instead of serial port.
There is a function in the esp-idf - esp_log_set_vprintf. It works, however, it doesn't work for the messages in arduino sketch, only the idf messages are displayed...
I have it like that:
#include "esp_log.h"
#include "esp_system.h"
int buffer_logging_vprintf( const char *str, va_list l ) {
Serial.println("aaaaaaa");
}
void setup(){
esp_log_level_set("*", ESP_LOG_VERBOSE);
esp_log_set_vprintf(buffer_logging_vprintf);
Serial.begin(115200);
log_i("Infoooooooo");
}
I expected output like only the aaaaaaa. However, the real output looks like:
[I][TestAsync.ino:316] setup(): Infoooooooo
[I][TestAsync.ino:102] connectToWifi(): Connecting wifi...
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
[W][WiFiGeneric.cpp:360] _eventCallback(): Reason: 2 - AUTH_EXPIRE
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
aaaaaaa
[I][TestAsync.ino:54] print_wakeup_reason(): Wakeup was not caused by deep sleep
[I][TestAsync.ino:338] setup(): Connected to AP in 4281 ms. IP: 192.168.1.50
[I][TestAsync.ino:342] setup(): Module time: 2018-11-06 00:04:48
[I][TestAsync.ino:348] setup(): Voltage: 3.32V
[I][TestAsync.ino:350] setup(): Starting Web server...
So as is seen, the idf messages are redirected correctly, but not the messages from sketch.
Any idea?
Robert
The text was updated successfully, but these errors were encountered: