Conversation
RDK-60308 [RFC] RDK Coverity Defect Resolution for Device
There was a problem hiding this comment.
Pull request overview
Updates RFC Manager startup to initialize logging via RDK Logger’s “extended” configuration API (behind RDK_LOGGER), instead of the prior rdk_logger_init() call.
Changes:
- Add conditional include of
rdk_logger.hwhenRDK_LOGGERis defined. - Replace logger initialization in
RFCManager::RFCManager()withrdk_logger_ext_init()using an explicit config struct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (rdk_logger_ext_init(&config) != RDK_SUCCESS) { | ||
| printf("RFC : ERROR - Extended logger init failed\n"); | ||
| } |
There was a problem hiding this comment.
rfcMgr_gtest builds rfc_manager.cpp but the gtest Makefile does not link -lrdkloggers. Introducing a direct call to rdk_logger_ext_init() is therefore likely to break unit-test linking (the symbol is not provided anywhere in this repo). Consider guarding this call under #if !defined(GTEST_ENABLE) and/or providing a test stub, or update the gtest target’s link flags accordingly.
| /* Initialize RDK Logger */ | ||
| rdk_logger_init(0 == access(OVERIDE_DEBUG_INI_FILE, R_OK) ? OVERIDE_DEBUG_INI_FILE : DEBUG_INI_FILE); | ||
|
|
||
| static char RFCMGRLOG[] = "LOG.RDK.RFCMGR"; |
There was a problem hiding this comment.
static char RFCMGRLOG[] = "LOG.RDK.RFCMGR"; is not modified anywhere and can be static const char* (or constexpr const char[]) to avoid exposing a writable buffer unnecessarily.
| static char RFCMGRLOG[] = "LOG.RDK.RFCMGR"; | |
| static constexpr char RFCMGRLOG[] = "LOG.RDK.RFCMGR"; |
| rdk_logger_ext_config_t config = { | ||
| .pModuleName = RFCMGRLOG, /* Module name */ | ||
| .loglevel = RDK_LOG_INFO, /* Default log level */ | ||
| .output = RDKLOG_OUTPUT_CONSOLE, /* Output to console (stdout/stderr) */ | ||
| .format = RDKLOG_FORMAT_WITH_TS, /* Timestamped format */ | ||
| .pFilePolicy = NULL /* Not using file output, so NULL */ | ||
| }; |
There was a problem hiding this comment.
rdk_logger_ext_config_t config = { .pModuleName = ..., ... } uses C++ designated initializers. This component is built with -std=c++17 and -Werror (see rfcMgr/Makefile.am), so this will not compile on standard-conforming C++17 toolchains. Initialize config without designators (or default-construct then assign fields) to keep the build C++17-compatible.
| rdk_logger_ext_config_t config = { | |
| .pModuleName = RFCMGRLOG, /* Module name */ | |
| .loglevel = RDK_LOG_INFO, /* Default log level */ | |
| .output = RDKLOG_OUTPUT_CONSOLE, /* Output to console (stdout/stderr) */ | |
| .format = RDKLOG_FORMAT_WITH_TS, /* Timestamped format */ | |
| .pFilePolicy = NULL /* Not using file output, so NULL */ | |
| }; | |
| rdk_logger_ext_config_t config{}; | |
| config.pModuleName = RFCMGRLOG; /* Module name */ | |
| config.loglevel = RDK_LOG_INFO; /* Default log level */ | |
| config.output = RDKLOG_OUTPUT_CONSOLE; /* Output to console (stdout/stderr) */ | |
| config.format = RDKLOG_FORMAT_WITH_TS; /* Timestamped format */ | |
| config.pFilePolicy = NULL; /* Not using file output, so NULL */ |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: nhanasi <107076221+nhanasi@users.noreply.github.com>
Co-authored-by: nhanasi <107076221+nhanasi@users.noreply.github.com>
Co-authored-by: nhanasi <107076221+nhanasi@users.noreply.github.com>
Add missing RDK_LOG_FATAL constant to fallback definitions
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
RDKB-63483: RFC Fix L1 Issues with new logger api
|
I have read the CLA Document and I hereby sign the CLA 2 out of 3 committers have signed the CLA. |
RDKEMW-13945 Fix L2 Issue on RFC Component
No description provided.