Fix handling of warning and error messages within log_make_debug-blocks
authorClifford Wolf <clifford@clifford.at>
Wed, 22 May 2019 11:46:38 +0000 (13:46 +0200)
committerClifford Wolf <clifford@clifford.at>
Wed, 22 May 2019 11:46:38 +0000 (13:46 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
kernel/log.cc

index 9a9104e265e379ac19652e3c42414d4727eb18aa..fa74a6a3c6ea257f79c996581b56bd6fcc409797 100644 (file)
@@ -230,6 +230,9 @@ static void logv_warning_with_prefix(const char *prefix,
        }
        else
        {
+               int bak_log_make_debug = log_make_debug;
+               log_make_debug = 0;
+
                for (auto &re : log_werror_regexes)
                        if (std::regex_search(message, re))
                                log_error("%s",  message.c_str());
@@ -254,6 +257,7 @@ static void logv_warning_with_prefix(const char *prefix,
                }
 
                log_warnings_count++;
+               log_make_debug = bak_log_make_debug;
        }
 }
 
@@ -285,6 +289,9 @@ static void logv_error_with_prefix(const char *prefix,
 #ifdef EMSCRIPTEN
        auto backup_log_files = log_files;
 #endif
+       int bak_log_make_debug = log_make_debug;
+       log_make_debug = 0;
+       log_suppressed();
 
        if (log_errfile != NULL)
                log_files.push_back(log_errfile);
@@ -298,6 +305,8 @@ static void logv_error_with_prefix(const char *prefix,
        log("%s%s", prefix, log_last_error.c_str());
        log_flush();
 
+       log_make_debug = bak_log_make_debug;
+
        if (log_error_atexit)
                log_error_atexit();