Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion rfcMgr/rfc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "rfc_manager.h"
#include "rfc_common.h"
#include "rfc_mgr_iarm.h"
#include "rdk_logger.h"
#include "rfc_xconf_handler.h"
#include <fstream>
#include <unistd.h>
Expand All @@ -40,7 +41,19 @@ namespace rfc {
#endif
RFCManager ::RFCManager() {
/* 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";
rdk_logger_ext_config_t config = {
.pModuleName = RFCMGRLOG, /* Module name */
Comment on lines +44 to +46
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 */

Copilot uses AI. Check for mistakes.
.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 */
};
Comment on lines +45 to +51
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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 */

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +51
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

if (rdk_logger_ext_init(&config) != RDK_SUCCESS) {
printf("RFC : ERROR - Extended logger init failed\n");
}
// rdk_logger_init(0 == access(OVERIDE_DEBUG_INI_FILE, R_OK) ? OVERIDE_DEBUG_INI_FILE : DEBUG_INI_FILE);

/* Initialize IARM Bus */
InitializeIARM();
Expand Down
Loading