Skip to content
Open
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
21 changes: 16 additions & 5 deletions legacy/LegacyNetworkAPIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ using namespace WPEFramework::Plugin;

#define LOG_INPARAM() { string json; parameters.ToString(json); NMLOG_INFO("params=%s", json.c_str() ); }
#define LOG_OUTPARAM() { string json; response.ToString(json); NMLOG_INFO("response=%s", json.c_str() ); }
#define DEBUGLOG_INPARAM() { string json; parameters.ToString(json); NMLOG_DEBUG("params=%s", json.c_str() ); }
#define DEBUGLOG_OUTPARAM() { string json; response.ToString(json); NMLOG_DEBUG("response=%s", json.c_str() ); }

#define returnJson(rc) \
{ \
Expand Down Expand Up @@ -516,7 +518,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN+1] = {
uint32_t rc = Core::ERROR_GENERAL;
JsonObject tmpResponse;

LOG_INPARAM();
DEBUGLOG_INPARAM();
rc = internalGetIPSettings(parameters, tmpResponse);

if (tmpResponse.HasLabel("ipaddr") && (!tmpResponse["ipaddr"].String().empty()))
Expand All @@ -526,17 +528,26 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN+1] = {
NMLOG_INFO("IP Address not assigned to the given interface yet");
rc = Core::ERROR_GENERAL;
}
returnJson(rc);
if (Core::ERROR_NONE == rc)
response["success"] = true;
else
response["success"] = false;
DEBUGLOG_OUTPARAM();
return Core::ERROR_NONE;
}

uint32_t Network::getIPSettings2 (const JsonObject& parameters, JsonObject& response)
{
LOG_INPARAM();
DEBUGLOG_INPARAM();
uint32_t rc = Core::ERROR_GENERAL;

rc = internalGetIPSettings(parameters, response);

returnJson(rc);
if (Core::ERROR_NONE == rc)
response["success"] = true;
else
response["success"] = false;
DEBUGLOG_OUTPARAM();
return Core::ERROR_NONE;
}

uint32_t Network::isConnectedToInternet(const JsonObject& parameters, JsonObject& response)
Expand Down
6 changes: 3 additions & 3 deletions plugin/gnome/NetworkManagerGnomeProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ namespace WPEFramework
}
result.ipaddress = nm_ip_address_get_address(ipAddr);
result.prefix = nm_ip_address_get_prefix(ipAddr);
NMLOG_INFO("IPv4 addr: %s/%d", result.ipaddress.c_str(), result.prefix);
NMLOG_DEBUG("IPv4 addr: %s/%d", result.ipaddress.c_str(), result.prefix);
}
Comment on lines 716 to 720
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says the change is only lowering repetitive getIPSettings logging, but this PR also changes IP address logs in NetworkManagerGnomeProxy (IPv4 addr / link-local / global) from INFO to DEBUG. Please update the PR description (or confirm these additional log-level changes are intended) so reviewers/operators understand the full logging impact.

Copilot uses AI. Check for mistakes.
}
gateway = nm_ip_config_get_gateway(ip4_config);
Expand Down Expand Up @@ -781,14 +781,14 @@ namespace WPEFramework
if (ipStr.compare(0, 5, "fe80:") == 0 || ipStr.compare(0, 6, "fe80::") == 0)
{
result.ula = ipStr;
NMLOG_INFO("link-local ip: %s", result.ula.c_str());
NMLOG_DEBUG("link-local ip: %s", result.ula.c_str());
}
else
{
result.prefix = nm_ip_address_get_prefix(ipAddr);
if(result.ipaddress.empty()) // SLAAC mutiple ip not added
result.ipaddress = ipStr;
NMLOG_INFO("global ip %s/%d", ipStr.c_str(), result.prefix);
NMLOG_DEBUG("global ip %s/%d", ipStr.c_str(), result.prefix);
}
}
}
Expand Down
Loading