Skip to content

Commit

Permalink
Remove duplicate check (netdata#16936)
Browse files Browse the repository at this point in the history
  • Loading branch information
stelfrag authored Feb 5, 2024
1 parent 0a6b731 commit 5818ff0
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/libnetdata/log/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -2162,13 +2162,11 @@ static void nd_logger(const char *file, const char *function, const unsigned lon
char os_threadname[NETDATA_THREAD_NAME_MAX + 1];
if(likely(!thread_log_fields[NDF_THREAD_TAG].entry.set)) {
const char *thread_tag = netdata_thread_tag();
if(!netdata_thread_tag_exists()) {
if (!netdata_thread_tag_exists()) {
os_thread_get_current_name_np(os_threadname);
if ('\0' != os_threadname[0])
/* If it is not an empty string replace "MAIN" thread_tag */
thread_tag = os_threadname;
}
if (!netdata_thread_tag_exists()) {
os_thread_get_current_name_np(os_threadname);
if ('\0' != os_threadname[0])
/* If it is not an empty string replace "MAIN" thread_tag */
thread_tag = os_threadname;
}
thread_log_fields[NDF_THREAD_TAG].entry = ND_LOG_FIELD_TXT(NDF_THREAD_TAG, thread_tag);

Expand Down Expand Up @@ -2311,13 +2309,11 @@ void netdata_logger_fatal( const char *file, const char *function, const unsigne

char os_threadname[NETDATA_THREAD_NAME_MAX + 1];
const char *thread_tag = netdata_thread_tag();
if(!netdata_thread_tag_exists()) {
if (!netdata_thread_tag_exists()) {
os_thread_get_current_name_np(os_threadname);
if ('\0' != os_threadname[0])
/* If it is not an empty string replace "MAIN" thread_tag */
thread_tag = os_threadname;
}
if (!netdata_thread_tag_exists()) {
os_thread_get_current_name_np(os_threadname);
if ('\0' != os_threadname[0])
/* If it is not an empty string replace "MAIN" thread_tag */
thread_tag = os_threadname;
}
if(!thread_tag)
thread_tag = "UNKNOWN";
Expand Down

0 comments on commit 5818ff0

Please sign in to comment.