]> granicus.if.org Git - esp-idf/commitdiff
This is a fix for the esp_log_level_set function. The problem is when this
authorDavid Ashley <dashxdr@gmail.com>
Sun, 28 Jan 2018 22:47:07 +0000 (16:47 -0600)
committerDavid Ashley <dashxdr@gmail.com>
Sun, 28 Jan 2018 22:47:07 +0000 (16:47 -0600)
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.

components/log/log.c

index 589f1983a1c7ff586262e1c28490bd3e72e61eb2..28bd89d80ccfe09fde5b4b2dca21429d0d37882f 100644 (file)
@@ -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;
         }