diff options
author | Ikjoon Jang <ikjn@google.com> | 2023-12-14 12:57:14 +0000 |
---|---|---|
committer | Ikjoon Jang <ikjn@google.com> | 2023-12-15 08:10:34 +0000 |
commit | 93beb47e067c224abfae06669ced6684e7bb8589 (patch) | |
tree | 36c2bb73afb8a9c7c44b5189e9c2b47f5d0d0399 | |
parent | e01837e90e4cd205a0a68aefee8d03f1301be3c2 (diff) | |
download | uwb-93beb47e067c224abfae06669ced6684e7bb8589.tar.gz |
Adjust log level of configuration files
No functional changes,
- Use ALOGV() in NxpConfig instead of using uwb_debug_enabled
- Do not use error log level in applying calibration parameters
Bug: 316321584
Test: check logcat
Change-Id: I4bcc6856439c591484cb9f4f42f3d0be064f82e1
-rw-r--r-- | halimpl/hal/phNxpUciHal_ext.cc | 4 | ||||
-rw-r--r-- | halimpl/utils/phNxpConfig.cc | 56 |
2 files changed, 30 insertions, 30 deletions
diff --git a/halimpl/hal/phNxpUciHal_ext.cc b/halimpl/hal/phNxpUciHal_ext.cc index 5a312b3..3244499 100644 --- a/halimpl/hal/phNxpUciHal_ext.cc +++ b/halimpl/hal/phNxpUciHal_ext.cc @@ -1077,7 +1077,7 @@ static void extcal_do_xtal(void) } if (xtal_data_len) { - NXPLOG_UCIHAL_E("Apply CLK_ACCURARY (len=%zu, from-otp=%c)", xtal_data_len, otp_xtal_flag ? 'y' : 'n'); + NXPLOG_UCIHAL_D("Apply CLK_ACCURARY (len=%zu, from-otp=%c)", xtal_data_len, otp_xtal_flag ? 'y' : 'n'); ret = sr1xx_apply_calibration(EXTCAL_PARAM_CLK_ACCURACY, 0, xtal_data, xtal_data_len); @@ -1223,7 +1223,7 @@ static void extcal_do_tx_base_band(void) // TX_BASE_BAND_CONTROL { - NXPLOG_UCIHAL_E("Apply TX_BASE_BAND_CONTROL: ddfs_enable=%u, dc_suppress=%u", ddfs_enable, dc_suppress); + NXPLOG_UCIHAL_D("Apply TX_BASE_BAND_CONTROL: ddfs_enable=%u, dc_suppress=%u", ddfs_enable, dc_suppress); uint8_t flag = 0; if (ddfs_enable) diff --git a/halimpl/utils/phNxpConfig.cc b/halimpl/utils/phNxpConfig.cc index 16bbbdf..dee83a0 100644 --- a/halimpl/utils/phNxpConfig.cc +++ b/halimpl/utils/phNxpConfig.cc @@ -16,6 +16,7 @@ * limitations under the License. * ******************************************************************************/ +//#define LOG_NDEBUG 0 #define LOG_TAG "NxpUwbConf" #include <sys/stat.h> @@ -230,10 +231,10 @@ bool CUwbNxpConfig::readConfig() /* open config file, read it into a buffer */ if ((fd = fopen(name, "r")) == NULL) { - ALOGD_IF(uwb_debug_enabled, "%s Cannot open config file %s\n", __func__, name); + ALOGD("%s Cannot open config file %s\n", __func__, name); return false; } - ALOGD_IF(uwb_debug_enabled, "%s Opened config %s\n", __func__, name); + ALOGV("%s Opened config %s\n", __func__, name); for (;;) { c = fgetc(fd); @@ -493,7 +494,7 @@ const uwbParam* CUwbNxpConfig::find(const char* p_name) const *******************************************************************************/ void CUwbNxpConfig::dump() const { - ALOGD("Dump configuration file %s : %s, %zu entries", mCurrentFile.c_str(), + ALOGV("Dump configuration file %s : %s, %zu entries", mCurrentFile.c_str(), mValidFile ? "valid" : "invalid", m_map.size()); for (auto &it : m_map) { @@ -521,7 +522,6 @@ uwbParam::uwbParam(const uwbParam ¶m) : m_arrStrValue(param.m_arrStrValue), m_type(param.m_type) { - ALOGD_IF(uwb_debug_enabled, "uwbParam copy-constructor"); } uwbParam::uwbParam(uwbParam &¶m) : @@ -562,22 +562,22 @@ uwbParam::uwbParam(vector<string> &&value) : void uwbParam::dump(const string &tag) const { if (m_type == type::NUMBER) { - ALOGD(" - %s = 0x%lx", tag.c_str(), m_numValue); + ALOGV(" - %s = 0x%lx", tag.c_str(), m_numValue); } else if (m_type == type::STRING) { - ALOGD(" - %s = %s", tag.c_str(), m_str_value.c_str()); + ALOGV(" - %s = %s", tag.c_str(), m_str_value.c_str()); } else if (m_type == type::BYTEARRAY) { stringstream ss_hex; ss_hex.fill('0'); for (auto b : m_arrValue) { ss_hex << setw(2) << hex << (int)b << " "; } - ALOGD(" - %s = { %s}", tag.c_str(), ss_hex.str().c_str()); + ALOGV(" - %s = { %s}", tag.c_str(), ss_hex.str().c_str()); } else if (m_type == type::STRINGARRAY) { stringstream ss; for (auto s : m_arrStrValue) { ss << "\"" << s << "\", "; } - ALOGD(" - %s = { %s}", tag.c_str(), ss.str().c_str()); + ALOGV(" - %s = { %s}", tag.c_str(), ss.str().c_str()); } } /*******************************************************************************/ @@ -620,7 +620,7 @@ public: const auto ®ion_str = it.first; const auto &cc_set = it.second; if (cc_set.find(code) != cc_set.end()) { - ALOGD_IF(uwb_debug_enabled, "map country code %c%c --> %s", + ALOGV("map country code %c%c --> %s", country_code[0], country_code[1], region_str.c_str()); return region_str; } @@ -633,7 +633,7 @@ public: m_map.clear(); } void dump() { - ALOGD("Region mapping dump:"); + ALOGV("Region mapping dump:"); for (auto &entry : m_map) { const auto ®ion_str = entry.first; const auto &cc_set = entry.second; @@ -641,7 +641,7 @@ public: for (const auto s : cc_set) { ss << "\"" << s << "\", "; } - ALOGD("- %s = { %s}", region_str.c_str(), ss.str().c_str()); + ALOGV("- %s = { %s}", region_str.c_str(), ss.str().c_str()); } } private: @@ -677,6 +677,17 @@ private: // Region Code mapping RegionCodeMap mRegionMap; + + void dump() { + mMainConfig.dump(); + mUciConfig.dump(); + + for (const auto &config : mExtraConfig) + config.dump(); + + mCapsConfig.dump(); + mRegionMap.dump(); + } }; CascadeConfig::CascadeConfig() @@ -685,7 +696,7 @@ CascadeConfig::CascadeConfig() void CascadeConfig::init(const char *main_config) { - ALOGD("CascadeConfig initialize with %s", main_config); + ALOGV("CascadeConfig initialize with %s", main_config); // Main config file CUwbNxpConfig config(main_config); @@ -723,7 +734,7 @@ void CascadeConfig::init(const char *main_config) if (!param) continue; CUwbNxpConfig config(param->str_value()); - ALOGI("Extra calibration file %s : %svalid", param->str_value(), config.isValid() ? "" : "in"); + ALOGD("Extra calibration file %s : %svalid", param->str_value(), config.isValid() ? "" : "in"); if (config.isValid() || config.isCountrySpecific()) { mExtraConfig.emplace_back(move(config)); } @@ -747,7 +758,7 @@ void CascadeConfig::init(const char *main_config) string strPath(loc.get()); strPath += country_code_config_name; - ALOGD_IF(uwb_debug_enabled, "Try to load %s", strPath.c_str()); + ALOGV("Try to load %s", strPath.c_str()); CUwbNxpConfig config(strPath.c_str()); @@ -776,20 +787,9 @@ void CascadeConfig::init(const char *main_config) mRegionMap.loadMapping(param->str_value()); } - if (uwb_debug_enabled) { - ALOGD("CascadeConfig initialized"); + ALOGD("CascadeConfig initialized"); - mMainConfig.dump(); - - for (const auto &config : mExtraConfig) - config.dump(); - - mCapsConfig.dump(); - - mRegionMap.dump(); - - mUciConfig.dump(); - } + dump(); } void CascadeConfig::deinit() @@ -805,7 +805,7 @@ void CascadeConfig::setCountryCode(const char country_code[2]) { string strCountry = mRegionMap.xlateCountryCode(country_code); - ALOGD_IF(uwb_debug_enabled, "Apply country code %c%c --> %s\n", country_code[0], country_code[1], strCountry.c_str()); + ALOGI("Apply country code %c%c --> %s\n", country_code[0], country_code[1], strCountry.c_str()); for (auto &x : mExtraConfig) { if (x.isCountrySpecific()) { x.setCountry(strCountry); |