Skip to content

Conversation

@Vismalskumar0
Copy link
Contributor

No description provided.

@Vismalskumar0 Vismalskumar0 requested a review from a team as a code owner February 11, 2026 19:42
Copilot AI review requested due to automatic review settings February 11, 2026 19:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.h when RDK_LOGGER is defined.
  • Replace logger initialization in RFCManager::RFCManager() with rdk_logger_ext_init() using an explicit config struct.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +56 to +58
if (rdk_logger_ext_init(&config) != RDK_SUCCESS) {
printf("RFC : ERROR - Extended logger init failed\n");
}
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.
/* 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.
Comment on lines +48 to +54
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 */
};
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants