@cryptotaxi247 / netdata-1 / commits / 5818ff0dc

Remove duplicate check (#16936)

Stelios Fragkakis committed Feb 5, 2024 at 17:49 UTC 5818ff0dc11b4f058931392b0deac57089403b3f
1 file changed +10 -14
src/libnetdata/log/log.c
+10 -14
@@ -2162,13 +2162,11 @@ static void nd_logger(const char *file, const char *function, const unsigned lon
2162 char os_threadname[NETDATA_THREAD_NAME_MAX + 1];
2163 if(likely(!thread_log_fields[NDF_THREAD_TAG].entry.set)) {
2164 const char *thread_tag = netdata_thread_tag();
2165 - if(!netdata_thread_tag_exists()) {
2166 - if (!netdata_thread_tag_exists()) {
2167 - os_thread_get_current_name_np(os_threadname);
2168 - if ('\0' != os_threadname[0])
2169 - /* If it is not an empty string replace "MAIN" thread_tag */
2170 - thread_tag = os_threadname;
2171 - }
2165 + if (!netdata_thread_tag_exists()) {
2166 + os_thread_get_current_name_np(os_threadname);
2167 + if ('\0' != os_threadname[0])
2168 + /* If it is not an empty string replace "MAIN" thread_tag */
2169 + thread_tag = os_threadname;
2170 }
2171 thread_log_fields[NDF_THREAD_TAG].entry = ND_LOG_FIELD_TXT(NDF_THREAD_TAG, thread_tag);
2172
@@ -2311,13 +2309,11 @@ void netdata_logger_fatal( const char *file, const char *function, const unsigne
2309
2310 char os_threadname[NETDATA_THREAD_NAME_MAX + 1];
2311 const char *thread_tag = netdata_thread_tag();
2314 - if(!netdata_thread_tag_exists()) {
2315 - if (!netdata_thread_tag_exists()) {
2316 - os_thread_get_current_name_np(os_threadname);
2317 - if ('\0' != os_threadname[0])
2318 - /* If it is not an empty string replace "MAIN" thread_tag */
2319 - thread_tag = os_threadname;
2320 - }
2312 + if (!netdata_thread_tag_exists()) {
2313 + os_thread_get_current_name_np(os_threadname);
2314 + if ('\0' != os_threadname[0])
2315 + /* If it is not an empty string replace "MAIN" thread_tag */
2316 + thread_tag = os_threadname;
2317 }
2318 if(!thread_tag)
2319 thread_tag = "UNKNOWN";