Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Logger API in C++ #3013

Merged
merged 5 commits into from
Oct 31, 2024
Merged

Conversation

bernardnormier
Copy link
Member

More string updates, mostly for the Logger API.

@@ -25,15 +25,15 @@ namespace
const chrono::minutes retryTimeout = chrono::minutes(5);
}

Ice::LoggerI::LoggerI(const string& prefix, const string& file, bool convert, size_t sizeMax)
: _prefix(prefix),
Ice::LoggerI::LoggerI(string prefix, const string& file, bool convert, size_t sizeMax)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't file be a string too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. The logic here was to update the public API but leave internal uses of const string& alone.

{
const string subsystem = prefix.empty() ? "com.zeroc.ice" : "com.zeroc.ice." + prefix;
const string subsystem = _prefix.empty() ? "com.zeroc.ice" : "com.zeroc.ice." + _prefix;
Copy link
Member

Choose a reason for hiding this comment

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

Not directly related, but we should probably make subsystem a member, we use it in trace too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@@ -12,7 +12,7 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;

Ice::SysLoggerI::SysLoggerI(const string& prefix, const string& facilityString) : _facility(0), _prefix(prefix)
Ice::SysLoggerI::SysLoggerI(string prefix, const string& facilityString) : _facility(0), _prefix(std::move(prefix))
Copy link
Member

Choose a reason for hiding this comment

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

Why do we keep facilityString as a reference?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. See earlier comment.

Copy link
Member

@externl externl left a comment

Choose a reason for hiding this comment

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

Looks good!

@bernardnormier bernardnormier merged commit 93e950e into zeroc-ice:main Oct 31, 2024
17 checks passed
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.

3 participants