Skip to content
Merged
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
5 changes: 2 additions & 3 deletions code/Common/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ void Logger::print(const String &msg, PrintMode mode) {
}
}

if (msg.size() > 8) {
if (msg[6] == '=' && msg[7] == '>') {
if (msg.size() > 8 && msg[6] == '=' && msg[7] == '>') {
mIntention += 2;
}
}
Expand Down Expand Up @@ -231,7 +230,7 @@ void Logger::registerLogStream(AbstractLogStream *pLogStream) {
mLogStreams.add(pLogStream);
}

void Logger::unregisterLogStream(AbstractLogStream *logStream) {
void Logger::unregisterLogStream(const AbstractLogStream *logStream) {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify header file signature matches.

The const-correctness improvement is good, making the function more permissive by accepting both const and non-const pointers. However, since this is a public API change, ensure the header file declaration has been updated to match this signature.

Run the following script to verify the header file contains the matching signature:


🏁 Script executed:

#!/bin/bash
# Description: Verify that Logger.h declares unregisterLogStream with const parameter

# Search for the function declaration in header files
rg -n "unregisterLogStream" --type=h -C 2

Length of output: 372


Update header file signature to match implementation.

The header file at include/cppcore/Common/Logger.h:169 still declares the old signature without const, but the implementation adds const to the parameter. This signature mismatch will cause compilation errors.

Update line 169 from:

void unregisterLogStream(AbstractLogStream *pLogStream);

to:

void unregisterLogStream(const AbstractLogStream *pLogStream);

Also note the parameter name differs between header (pLogStream) and implementation (logStream)—consider standardizing for consistency.

🤖 Prompt for AI Agents
In include/cppcore/Common/Logger.h around line 169, the declaration still uses a
non-const parameter but the implementation in code/Common/Logger.cpp at line 233
uses const; update the header declaration to match the implementation by
changing the parameter type to const AbstractLogStream * and, for consistency,
align the parameter name with the implementation (e.g., use logStream or
pLogStream consistently) so the signature and names match across header and
source.

if (nullptr == logStream) {
return;
}
Expand Down