This is an automated email from the ASF dual-hosted git repository.

dmeden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 26117de332 cleanup: Remove leftover from remote management logging 
initialization. (#11782)
26117de332 is described below

commit 26117de332b1dd35ae7a88eb1bce226199a4d91e
Author: Damian Meden <[email protected]>
AuthorDate: Wed Sep 25 09:58:43 2024 +0200

    cleanup: Remove leftover from remote management logging initialization. 
(#11782)
---
 include/proxy/logging/Log.h                         |  3 +--
 src/proxy/logging/Log.cc                            | 15 +++------------
 src/proxy/logging/unit-tests/benchmark_LogObject.cc |  2 +-
 src/traffic_logcat/logcat.cc                        |  2 +-
 src/traffic_logstats/logstats.cc                    |  2 +-
 5 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/include/proxy/logging/Log.h b/include/proxy/logging/Log.h
index 047d903b78..983a8ae975 100644
--- a/include/proxy/logging/Log.h
+++ b/include/proxy/logging/Log.h
@@ -135,8 +135,7 @@ public:
   };
 
   enum ConfigFlags {
-    NO_REMOTE_MANAGEMENT = 1,
-    LOGCAT               = 4,
+    LOGCAT = 1,
   };
 
   enum RollingEnabledValues {
diff --git a/src/proxy/logging/Log.cc b/src/proxy/logging/Log.cc
index 2b884393ec..73675a5b2c 100644
--- a/src/proxy/logging/Log.cc
+++ b/src/proxy/logging/Log.cc
@@ -1080,15 +1080,10 @@ Log::init(int flags)
     REC_RegisterConfigUpdateFunc("proxy.config.log.periodic_tasks_interval", 
&Log::handle_periodic_tasks_int_change, nullptr);
   }
 
-  // if remote management is enabled, do all necessary initialization to
-  // be able to handle a logging mode change
-  //
-  if (!(config_flags & NO_REMOTE_MANAGEMENT)) {
-    REC_RegisterConfigUpdateFunc("proxy.config.log.logging_enabled", 
&Log::handle_logging_mode_change, nullptr);
-  }
-
   init_fields();
   if (!(config_flags & LOGCAT)) {
+    REC_RegisterConfigUpdateFunc("proxy.config.log.logging_enabled", 
&Log::handle_logging_mode_change, nullptr);
+
     Dbg(dbg_ctl_log_config, "Log::init(): logging_mode = %d init status = %d", 
logging_mode, init_status);
     config->init();
     init_when_enabled();
@@ -1102,11 +1097,7 @@ Log::init_when_enabled()
   ink_release_assert(config->initialized == true);
 
   if (!(init_status & FULLY_INITIALIZED)) {
-    // register callbacks
-    //
-    if (!(config_flags & NO_REMOTE_MANAGEMENT)) {
-      LogConfig::register_config_callbacks();
-    }
+    LogConfig::register_config_callbacks();
 
     // create the flush thread
     create_threads();
diff --git a/src/proxy/logging/unit-tests/benchmark_LogObject.cc 
b/src/proxy/logging/unit-tests/benchmark_LogObject.cc
index e42f583907..ba510fc52d 100644
--- a/src/proxy/logging/unit-tests/benchmark_LogObject.cc
+++ b/src/proxy/logging/unit-tests/benchmark_LogObject.cc
@@ -111,7 +111,7 @@ TEST_CASE("LogObject", "[proxy/logging]")
 
   pmgmt = new ProcessManager(false);
 
-  Log::init(Log::NO_REMOTE_MANAGEMENT);
+  Log::init();
 
   LogFormat *fmt = MakeTextLogFormat();
 
diff --git a/src/traffic_logcat/logcat.cc b/src/traffic_logcat/logcat.cc
index 6c0e7dd9ec..afcd2fa9ca 100644
--- a/src/traffic_logcat/logcat.cc
+++ b/src/traffic_logcat/logcat.cc
@@ -276,7 +276,7 @@ main(int /* argc ATS_UNUSED */, const char *argv[])
   //
   init_log_standalone_basic(PROGRAM_NAME);
 
-  Log::init(Log::NO_REMOTE_MANAGEMENT | Log::LOGCAT);
+  Log::init(Log::LOGCAT);
 
   // setup output file
   //
diff --git a/src/traffic_logstats/logstats.cc b/src/traffic_logstats/logstats.cc
index 554f95c8cd..dc18d04826 100644
--- a/src/traffic_logstats/logstats.cc
+++ b/src/traffic_logstats/logstats.cc
@@ -2459,7 +2459,7 @@ main(int /* argc ATS_UNUSED */, const char *argv[])
 
   // initialize this application for standalone logging operation
   init_log_standalone_basic(PROGRAM_NAME);
-  Log::init(Log::NO_REMOTE_MANAGEMENT | Log::LOGCAT);
+  Log::init(Log::LOGCAT);
 
   // Do we have a list of Origins on the command line?
   if (cl.origin_list[0] != '\0') {

Reply via email to