Code: Select all
esp_log_level_set("mytag", ESP_LOG_DEBUG);
Code: Select all
void set_debug(char * tag) {
esp_log_level_set(tag, ESP_LOG_DEBUG);
}
Is this a limitation in the way the logging mechanism works?
I'm using ESP-IDF 3.0.6+ (7e0ea6b05db8ad5d1a8dc183414ca8cd456ec934).
EDIT: After inspecting components/log/log.c it seems like a complete mystery to me. There is no macro magic, and the tag parameter is simply compared or copied, so any null-terminated char pointer should work fine.
EDIT2: I've printf-traced through esp_log_level_set() with both a literal tag and a variable tag, and the behaviour seems to be identical. In both cases, it->level is set to the specified level.