Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
quzard committed Dec 20, 2024
1 parent 0afb1b0 commit 9ada24f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 46 deletions.
56 changes: 11 additions & 45 deletions core/app_config/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion core/app_config/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ std::string GetGoPluginCheckpoint();
std::string GetAgentName();
std::string GetMonitorInfoFileName();
std::string GetSymLinkName();
std::string GetPidFileName();
std::string GetAgentPrefix();

template <class T>
Expand Down

0 comments on commit 9ada24f

Please sign in to comment.