From 9ada24f494ca8210b496aebda82ccabf1af6e568 Mon Sep 17 00:00:00 2001 From: quzard <1191890118@qq.com> Date: Fri, 20 Dec 2024 10:02:35 +0800 Subject: [PATCH] fix --- core/app_config/AppConfig.cpp | 56 +++++++---------------------------- core/app_config/AppConfig.h | 1 - 2 files changed, 11 insertions(+), 46 deletions(-) diff --git a/core/app_config/AppConfig.cpp b/core/app_config/AppConfig.cpp index 87a9a1ac4c..27aa6116cf 100644 --- a/core/app_config/AppConfig.cpp +++ b/core/app_config/AppConfig.cpp @@ -40,11 +40,13 @@ using namespace std; -#define ILOGTAIL_PREFIX "ilogtail_" -#define ILOGTAIL_PIDFILE_SUFFIX ".pid" #define LOONGCOLLECTOR_PREFIX "loongcollector_" +#ifdef __ENTERPRISE__ +DEFINE_FLAG_BOOL(logtail_mode, "logtail mode", true); +#else DEFINE_FLAG_BOOL(logtail_mode, "logtail mode", false); +#endif DEFINE_FLAG_INT32(max_buffer_num, "max size", 40); DEFINE_FLAG_INT32(pub_max_buffer_num, "max size", 8); DEFINE_FLAG_INT32(pub_max_send_byte_per_sec, "the max send speed per sec, realtime thread", 20 * 1024 * 1024); @@ -423,11 +425,7 @@ string GetAgentLoggersPrefix() { } string GetAgentLogName() { - if (BOOL_FLAG(logtail_mode)) { - return "ilogtail.LOG"; - } else { - return "loongcollector.LOG"; - } + return "loongcollector.LOG"; } string GetObserverEbpfHostPath() { @@ -481,19 +479,11 @@ string GetContinuousPipelineConfigDir() { } string GetPluginLogName() { - if (BOOL_FLAG(logtail_mode)) { - return "logtail_plugin.LOG"; - } else { - return "go_plugin.LOG"; - } + return "go_plugin.LOG"; } std::string GetVersionTag() { - if (BOOL_FLAG(logtail_mode)) { - return "logtail_version"; - } else { - return "loongcollector_version"; - } + return "loongcollector_version"; } std::string GetGoPluginCheckpoint() { @@ -505,43 +495,19 @@ std::string GetGoPluginCheckpoint() { } std::string GetAgentName() { - if (BOOL_FLAG(logtail_mode)) { - return "ilogtail"; - } else { - return "loongcollector"; - } + return "loongcollector"; } std::string GetMonitorInfoFileName() { - if (BOOL_FLAG(logtail_mode)) { - return "logtail_monitor_info"; - } else { - return "loongcollector_monitor_info"; - } + return "loongcollector_monitor_info"; } std::string GetSymLinkName() { - if (BOOL_FLAG(logtail_mode)) { - return GetProcessExecutionDir() + "ilogtail"; - } else { - return GetProcessExecutionDir() + "loongcollector"; - } -} - -std::string GetPidFileName() { - if (BOOL_FLAG(logtail_mode)) { - return GetProcessExecutionDir() + ILOGTAIL_PREFIX + ILOGTAIL_VERSION + ILOGTAIL_PIDFILE_SUFFIX; - } else { - return GetAgentRunDir() + "loongcollector.pid"; - } + return GetProcessExecutionDir() + "loongcollector"; } std::string GetAgentPrefix() { - if (BOOL_FLAG(logtail_mode)) { - return ILOGTAIL_PREFIX; - } else { - return LOONGCOLLECTOR_PREFIX; - } + return LOONGCOLLECTOR_PREFIX; } AppConfig::AppConfig() { diff --git a/core/app_config/AppConfig.h b/core/app_config/AppConfig.h index a1f0af7ec5..609c4379f6 100644 --- a/core/app_config/AppConfig.h +++ b/core/app_config/AppConfig.h @@ -60,7 +60,6 @@ std::string GetGoPluginCheckpoint(); std::string GetAgentName(); std::string GetMonitorInfoFileName(); std::string GetSymLinkName(); -std::string GetPidFileName(); std::string GetAgentPrefix(); template