summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2024-04-11 07:40:52 -0400
committerGitHub <noreply@github.com>2024-04-11 07:40:52 -0400
commit8c84a6241ba89cd10b257ca37b442cf358ac7597 (patch)
treeefea81e3beb6c368291e50e37fd192648296d3b2
parentf455b10f8911eae36a365c1d088168fe082e6894 (diff)
Remove seemingly dead logging related code from libnetdata. (#17320)
Remove seemingly dead code from libnetdata. overwrite_thread_source is only accessed in two locations: - It gets written to only by nd_log_set_thread_source, which does not appear to ever be called anywhere in our current code. - It is only ever read by nd_log_validate_source, which because nd_log_set_thread_source is never called should never end up resulting in any actual behavioral changes (since it will always be 0). Based on this, the code is functionally dead, and therefore can safely be removed.
-rw-r--r--src/libnetdata/log/log.c9
-rw-r--r--src/libnetdata/log/log.h1
2 files changed, 0 insertions, 10 deletions
diff --git a/src/libnetdata/log/log.c b/src/libnetdata/log/log.c
index bfba93ddb2..2be7a78813 100644
--- a/src/libnetdata/log/log.c
+++ b/src/libnetdata/log/log.c
@@ -367,12 +367,6 @@ struct nd_log_source {
struct nd_log_limit limits;
};
-static __thread ND_LOG_SOURCES overwrite_thread_source = 0;
-
-void nd_log_set_thread_source(ND_LOG_SOURCES source) {
- overwrite_thread_source = source;
-}
-
static struct {
uuid_t invocation_id;
@@ -2237,9 +2231,6 @@ static ND_LOG_SOURCES nd_log_validate_source(ND_LOG_SOURCES source) {
if(source >= _NDLS_MAX)
source = NDLS_DAEMON;
- if(overwrite_thread_source)
- source = overwrite_thread_source;
-
if(nd_log.overwrite_process_source)
source = nd_log.overwrite_process_source;
diff --git a/src/libnetdata/log/log.h b/src/libnetdata/log/log.h
index 51d6c8bff5..3bafbe89bf 100644
--- a/src/libnetdata/log/log.h
+++ b/src/libnetdata/log/log.h
@@ -150,7 +150,6 @@ void chown_open_file(int fd, uid_t uid, gid_t gid);
void nd_log_chown_log_files(uid_t uid, gid_t gid);
void nd_log_set_flood_protection(size_t logs, time_t period);
void nd_log_initialize_for_external_plugins(const char *name);
-void nd_log_set_thread_source(ND_LOG_SOURCES source);
bool nd_log_journal_socket_available(void);
ND_LOG_FIELD_ID nd_log_field_id_by_name(const char *field, size_t len);
int nd_log_priority2id(const char *priority);