RDKEMW-13612-RFC Logs Not Found in the rfcscript.log in RDKE Builds#168
RDKEMW-13612-RFC Logs Not Found in the rfcscript.log in RDKE Builds#168Vismalskumar0 wants to merge 1 commit intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates RFC Manager’s logging initialization to address missing RFC logs in RDKE builds by switching from rdk_logger_init(debug.ini) to the extended logger initialization path.
Changes:
- Added
rdk_logger.hinclude. - Replaced
rdk_logger_init(...)withrdk_logger_ext_init(...)using an explicit module/config struct. - Hardcoded default log level/output/format in the new config.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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.
rfcMgr is built with -std=c++17 (see rfcMgr/Makefile.am), but this uses C99/C++20-style designated initializers (.pModuleName = ...). This is not valid C++17 and will fail to compile on standard-compliant toolchains. Initialize the struct without designated initializers (e.g., default-construct then assign fields, or use positional aggregate initialization if the struct is an aggregate).
| 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 */ |
| .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.
This replaces rdk_logger_init(…debug.ini…) with a hardcoded extended-logger config (INFO level, console output, no file policy). That removes runtime configurability via /etc/debug.ini/override paths and may change where logs are written. Consider continuing to honor the debug.ini selection (or mapping its settings into the ext config) instead of hardcoding output/level.
| static char RFCMGRLOG[] = "LOG.RDK.RFCMGR"; | ||
| rdk_logger_ext_config_t config = { | ||
| .pModuleName = RFCMGRLOG, /* Module name */ |
There was a problem hiding this comment.
RFCMGRLOG duplicates the existing LOG_RFCMGR module name macro (defined in rfc_common.h) and is mutable (char[]) even though it’s a constant string. Prefer reusing LOG_RFCMGR and making the module name const char*/constexpr to avoid duplication and accidental mutation.
| static char RFCMGRLOG[] = "LOG.RDK.RFCMGR"; | |
| rdk_logger_ext_config_t config = { | |
| .pModuleName = RFCMGRLOG, /* Module name */ | |
| rdk_logger_ext_config_t config = { | |
| .pModuleName = LOG_RFCMGR, /* Module name */ |
No description provided.