-
Notifications
You must be signed in to change notification settings - Fork 593
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
Update Logger API in C++ #3013
Conversation
cpp/src/Ice/LoggerI.cpp
Outdated
@@ -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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
cpp/src/Ice/OSLogLoggerI.cpp
Outdated
{ | ||
const string subsystem = prefix.empty() ? "com.zeroc.ice" : "com.zeroc.ice." + prefix; | ||
const string subsystem = _prefix.empty() ? "com.zeroc.ice" : "com.zeroc.ice." + _prefix; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
cpp/src/Ice/SysLoggerI.cpp
Outdated
@@ -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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. See earlier comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
More string updates, mostly for the Logger API.