Skip to content
Merged
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
12 changes: 6 additions & 6 deletions session/eventlog/event_sdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ WriteEventLog fp_writeEventLog = nullptr;
void *handler = nullptr;

// Check if event logging should be enabled based on system edition
// Only UosProfessional is enabled by default
// Not UosCommunity is enabled by default
// Reads /etc/os-version to determine edition
static bool shouldEnableEventLog()
{
#ifdef DDE_EVENTLOG_DEBUG_ENABLE_CURRENT_VERSION
// Debug mode: enable for current system version
return true;
#else
// Production mode: only enable for UosProfessional edition
// Production mode: disable for UosCommunity edition
// Read /etc/os-version and check EditionName
ifstream osVersion("/etc/os-version");
if (!osVersion.is_open()) {
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
return false;
return true;
}

string line;
while (getline(osVersion, line)) {
// Look for EditionName=Professional
// Check if edition is not Community
if (line.find("EditionName=") == 0) {
string edition = line.substr(12); // Skip "EditionName="
osVersion.close();
return edition == "Professional";
return edition != "Community";
}
}
osVersion.close();
return false;
return true;
#endif
}

Expand Down
Loading