From 7dabb0433da3844ecb9ed4270a3bb882d894b510 Mon Sep 17 00:00:00 2001 From: Andrei Radulescu Date: Thu, 23 Nov 2023 17:07:59 +0200 Subject: [PATCH] Extra logging in Params --- common/params.cc | 9 +++++++-- common/params.h | 11 ++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/common/params.cc b/common/params.cc index 54168165a176ec..91e9cf70543d1a 100644 --- a/common/params.cc +++ b/common/params.cc @@ -7,7 +7,6 @@ #include #include -#include "common/swaglog.h" #include "common/util.h" #include "system/hardware/hw.h" @@ -282,7 +281,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.c_str(), "GsmApn") == 0) { + LOGE("Params::get %s: %s", key.c_str(), value.c_str()); + } + + return value; } else { // blocking read until successful params_do_exit = 0; diff --git a/common/params.h b/common/params.h index fbe0bba6b0da3c..248c83fb8ef14b 100644 --- a/common/params.h +++ b/common/params.h @@ -2,8 +2,11 @@ #include #include +#include #include +#include "common/swaglog.h" + enum ParamKeyType { PERSISTENT = 0x02, CLEAR_ON_MANAGER_START = 0x04, @@ -24,7 +27,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.c_str(), "GsmApn") == 0) { + LOGE("Params path: %s", path.c_str()); + } + + return path; } // Delete a value