Skip to content
Open
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions ds/frontPanelIndicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,12 @@ uint32_t FrontPanelIndicator::getColor()
*/
void FrontPanelIndicator::setColor(const FrontPanelIndicator::Color & color,bool toPersist)
{
INT_INFO("[%s:%d] Color id = %d, color name = %s", __FUNCTION__, __LINE__, color.getId(), color.getName().c_str());
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

INT_INFO already logs file/line/function via ds_log (see ds/dslogger.cpp:66-72). Including [%s:%d] with __FUNCTION__/__LINE__ in the message is redundant and makes logs noisier; consider removing that prefix and logging just the relevant fields (or moving this to INT_DEBUG if it's primarily for troubleshooting).

Copilot uses AI. Check for mistakes.

bool IsPersist = toPersist;
if(_colorMode == 0 || _colorMode == 1)
{
INT_INFO("[%s:%d] Color mode is %d, API not supported", __FUNCTION__, __LINE__, _colorMode);
throw UnsupportedOperationException("This API not supported for the color mode");
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The log/exception text is grammatically incorrect and not very actionable ("This API not supported..."). Consider changing it to "This API is not supported for color mode X" (including _colorMode), so failures are clearer in telemetry and in exception reports.

Copilot uses AI. Check for mistakes.
}
else if(_colorMode == 2)
Expand All @@ -488,6 +490,7 @@ void FrontPanelIndicator::setColor(const FrontPanelIndicator::Color & color,bool
const List<FrontPanelIndicator::Color> supportedColors = FrontPanelConfig::getInstance().getColors();
for (uint j = 0; j < supportedColors.size(); j++)
{
INT_INFO("[%s:%d] Supported color id = %d, color id = %d", __FUNCTION__, __LINE__, supportedColors.at(j).getId(), color.getId());
if( supportedColors.at(j).getId() == color.getId())
Comment thread
nanimatta marked this conversation as resolved.
{
isValidColor = true;
Expand All @@ -496,6 +499,7 @@ void FrontPanelIndicator::setColor(const FrontPanelIndicator::Color & color,bool
}
if(!isValidColor)
{
INT_INFO("[%s:%d] Invalid color id = %d", __FUNCTION__, __LINE__, color.getId());
throw IllegalArgumentException("Invalid color object");
Comment thread
nanimatta marked this conversation as resolved.
}
}
Expand Down
Loading