Skip to content
Closed

Merge #171

Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
19 changes: 17 additions & 2 deletions rfcMgr/rfc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "rfc_common.h"
#include "rfc_mgr_iarm.h"
#include "rfc_xconf_handler.h"
#if defined(RDK_LOGGER)
#include "rdk_logger.h"
#endif
#include <fstream>
#include <unistd.h>
#include <sys/types.h>
Expand All @@ -39,9 +42,21 @@ namespace rfc {
}
#endif
RFCManager ::RFCManager() {
#if defined(RDK_LOGGER)
/* 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";
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
static char RFCMGRLOG[] = "LOG.RDK.RFCMGR";
static constexpr char RFCMGRLOG[] = "LOG.RDK.RFCMGR";

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

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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.

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.

if (rdk_logger_ext_init(&config) != RDK_SUCCESS) {
printf("RFC : ERROR - Extended logger init failed\n");
}
Comment on lines +56 to +58
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
#endif
/* Initialize IARM Bus */
InitializeIARM();
}
Expand Down