Skip to content

Commit

Permalink
Extra logging in Params
Browse files Browse the repository at this point in the history
  • Loading branch information
andiradulescu committed Nov 23, 2023
1 parent 5d12b44 commit 942f169
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion common/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@ int Params::remove(const std::string &key) {

std::string Params::get(const std::string &key, bool block) {
if (!block) {
return util::read_file(getParamPath(key));
std::string value = util::read_file(getParamPath(key))

if (strcmp(key, "GsmApn") == 0) {
LOGE("Params::get %s: %s", key, value);
}

return value;
} else {
// blocking read until successful
params_do_exit = 0;
Expand Down
8 changes: 7 additions & 1 deletion common/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ class Params {
bool checkKey(const std::string &key);
ParamKeyType getKeyType(const std::string &key);
inline std::string getParamPath(const std::string &key = {}) {
return params_path + prefix + (key.empty() ? "" : "/" + key);
std::string path = params_path + prefix + (key.empty() ? "" : "/" + key);

if (strcmp(key, "GsmApn") == 0) {
LOGE("Params path: %s", path);
}

return path;
}

// Delete a value
Expand Down

0 comments on commit 942f169

Please sign in to comment.