-
Notifications
You must be signed in to change notification settings - Fork 69
Fix ILogger::operator<< when called on list<string> #130
Conversation
|
Build breaks because the skeleton plugin is not explicitly compiled with C++11 and ILogger.h now requires it. |
9efe1b6 to
fe3a46c
Compare
Since the core is moving to C++11, some headers will at some point contain C++11-only features which will make it necessary to switch plugins to C++11 as well. Signed-off-by: David Wagner <david.wagner@intel.com>
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.
Are you sure this empty test is still useful ? A stream string is only created if there is things to put in.
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.
right.
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.
maybe we could add std::to_string instead of an ostringstream ?
mLogs.back += std::to_string(log);... Never mind, std::to_string(std::string) (<=> id) does not exist. Unfortunately.
You could add a private overload in your file though.
std::string to_string(const std::string &str) { return str; }
...
using std::to_string
mLogs.back += to_string(log);
...
std::list<std::string> mLogs;Calling info() << someList should be identical to calling info() << element on each element of someList. This was not the case because when used on a list, the string was concatenated with \n and the logging callback called once. Instead, the logging callback is now called for each line. Fixes intel#125. Signed-off-by: David Wagner <david.wagner@intel.com>
|
👍 |
Fix ILogger::operator<< when called on list<string> Calling info() << someList should be identical to calling info() << element on each element of someList. This was not the case because when used on a list, the string was concatenated with \n and the logging callback called once. Instead, the logging callback is now called for each line. Fixes #125.
Calling info() << someList should be identical to calling info() << element on
each element of someList.
This was not the case because when used on a list, the string was concatenated
with \n and the logging callback called once. Instead, the logging callback
is now called for each line.
Fixes #125.
Signed-off-by: David Wagner david.wagner@intel.com