RDKEMW-13945-Fix L1 Issue on RFC Component#181
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the rfcMgr/rdk_debug.h header, which previously provided RDK logger includes and fallback logging definitions used by multiple components.
Changes:
- Deleted
rfcMgr/rdk_debug.h(logger wrapper / fallback definitions).
Comments suppressed due to low confidence (1)
rfcMgr/rdk_debug.h:1
- Deleting this header will break builds: rfcMgr/rfc_common.h (and other sources like rfcapi/rfcapi.cpp and tr181api/tr181api.cpp) include "rdk_debug.h", and rfcMgr/Makefile.am adds -I${top_srcdir}/rfcMgr so the compiler previously resolved it from this path. Unless every include is updated to a different header and the build is adjusted to provide that replacement on the include path, this PR introduces a hard compile failure. Please either restore rfcMgr/rdk_debug.h or replace it with an equivalent header and update all include sites/build flags accordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
rfcMgr/rdk_debug.h:1
- The PR title "TEST" is not descriptive and does not explain the purpose or intent of deleting this entire header file. A proper title should describe what is being changed and why, especially for a significant change like removing a widely-used header file. This appears to be either a test commit that should not have been opened as a PR, or lacks proper documentation of the intended change.
rfcMgr/rdk_debug.h:1 - Deleting this header file will break the build. This file is included by multiple source files in the codebase including rfcMgr/rfc_common.h, rfcapi/rfcapi.cpp, and tr181api/tr181api.cpp. Additionally, rfcMgr/rfc_manager.cpp uses the rdk_logger_ext_init function and rdk_logger_ext_config_t type which are defined only in this file and not in the test mock version at rfcMgr/gtest/mocks/rdk_debug.h. The production code in rfc_manager.cpp also uses RDK_LOGGER_INIT macro, RDK_SUCCESS constant, RDKLOG_OUTPUT_CONSOLE, and RDKLOG_FORMAT_WITH_TS enums that are defined in this file. Files that include this header also depend on RDK_LOG_FATAL, RDK_LOG_WARN, and RDK_LOG_TRACE1 definitions that are missing from the mock version.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
rfcMgr/gtest/mocks/rdk_debug.h:75
- The RDK_LOG macro does not handle the RDK_LOG_WARN level, even though RDK_LOG_WARN is defined on line 31 and used in production code (e.g., rfc_common.cpp:357, rfc_manager.cpp:550, rfc_xconf_handler.cpp:1087). When warnings are logged in tests, they will be printed without a "WARN:" prefix, making it harder to distinguish warning messages from info or other log levels. Add an else-if branch to handle RDK_LOG_WARN similar to the existing branches for DEBUG, INFO, and ERROR.
#define RDK_LOG(level, module, ...) \
do { \
if (( level == RDK_LOG_DEBUG )) { \
printf("DEBUG: %s: ", module); \
} \
else if (( level == RDK_LOG_INFO )) { \
printf("INFO: %s: ", module); \
} \
else if (( level == RDK_LOG_ERROR )) { \
printf("ERROR: %s: ", module); \
} \
printf(__VA_ARGS__); \
} while (0)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added the mocks to make Unit Test work after the logger changes