From bab3825795073446c219be314d5d1ac4c3478c3d Mon Sep 17 00:00:00 2001 From: David Ashley Date: Sun, 28 Jan 2018 16:47:07 -0600 Subject: [PATCH] log: fix tag comparison in esp_log_level_set This is a fix for the esp_log_level_set function. The problem is when this function is called but NOT withe the same 'c' string constant that the LOG* calls used in each module, the cache check doesn't match, so the cached entry won't get updated. There's no point in optimizing this function anyway because it is only called rarely. Merges https://github.com/espressif/esp-idf/pull/1557 Closes https://github.com/espressif/esp-idf/pull/2996 --- components/log/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/log/log.c b/components/log/log.c index 589f1983a..28bd89d80 100644 --- a/components/log/log.c +++ b/components/log/log.c @@ -164,7 +164,7 @@ void esp_log_level_set(const char* tag, esp_log_level_t level) #ifdef LOG_BUILTIN_CHECKS assert(i == 0 || s_log_cache[(i - 1) / 2].generation < s_log_cache[i].generation); #endif - if (s_log_cache[i].tag == tag) { + if (strcmp(s_log_cache[i].tag,tag) == 0) { s_log_cache[i].level = level; break; }