Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set the logtail_mode flag to true for enterprise builds #1976

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading