Bug #2486

rsc logger seems to have problems with stringstreams

Added by C. Emmerich about 8 years ago. Updated about 8 years ago.

Status:ResolvedStart date:02/11/2016
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:-

Description

When running the following program

#include <stdio.h>
#include <rsc/logging/Logger.h>

using namespace std;

int main() {
    rsc::logging::LoggerPtr logger = rsc::logging::Logger::getLogger("testlogger");

    stringstream s;
    for (uint i = 0; i < 5; ++i) {
        s << i << " ";
    }
    cout << s.str() << endl;
    RSCERROR(logger, "rsc::logging: " << s.str());

    return EXIT_SUCCESS;
}

I get the following output:

0 1 2 3 4 
1455195279558 testlogger [ERROR]: rsc::logging: 

But I would expect, that the rsc logger also outputs the values from the stringstream.

What is wrong here?

Associated revisions

Revision 6891d9d3
Added by J. Wienke about 8 years ago

Prevent variable name conflicts in logging macros

The logging macros contained a variable which was very likely to
conflict with client code variable names. Use something very unique now
to prevent this clash

fixes #2486

History

#1 Updated by J. Wienke about 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF