Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

@dawagner
Copy link
Contributor

@dawagner dawagner commented Jun 3, 2015

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

@dawagner dawagner added the bug label Jun 3, 2015
@dawagner dawagner added this to the Version 3 milestone Jun 3, 2015
@dawagner
Copy link
Contributor Author

dawagner commented Jun 3, 2015

@krocard @clero @OznOg please review.

@dawagner
Copy link
Contributor Author

dawagner commented Jun 3, 2015

Build breaks because the skeleton plugin is not explicitly compiled with C++11 and ILogger.h now requires it.

@dawagner dawagner force-pushed the fix-log-on-list branch 2 times, most recently from 9efe1b6 to fe3a46c Compare June 3, 2015 12:53
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>
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right.

Copy link
Contributor

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>
@clero
Copy link
Contributor

clero commented Jun 4, 2015

👍

dawagner added a commit that referenced this pull request Jun 4, 2015
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.
@dawagner dawagner merged commit 99e7ef8 into intel:next Jun 4, 2015
@dawagner dawagner deleted the fix-log-on-list branch June 4, 2015 12:05
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 70.41% when pulling ccd7ce4 on dawagner:fix-log-on-list into 3e38382 on 01org:next.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants