I use "OstreamAppender" and "PatternLayout", but sometimes Log4cpp crash in "oprator<<" , I think "PatternLayout::format" have problem. it shuold be like this:
Nope :), it should'nt. message.str() allready has std::string type and such wrapping is useless. If you work on Windows try to check runtimes - that common problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sstd::string PatternLayout::format(const LoggingEvent& event) {
std::ostringstream message;
for(ComponentVector::const_iterator i = _components.begin();
i != _components.end(); ++i) {
(*i)->append(message, event);
}
[b]return message.str();[/b]
}
I use "OstreamAppender" and "PatternLayout", but sometimes Log4cpp crash in "oprator<<" , I think "PatternLayout::format" have problem. it shuold be like this:
Nope :), it should'nt. message.str() allready has std::string type and such wrapping is useless. If you work on Windows try to check runtimes - that common problem.