|
|
Choosing A Webhost: |
Re: Possible error with logging a stringstream: msg#00039apache.logging.log4cxx.user
On Dec 21, 2006, at 4:21 AM, Tomas Andersen wrote: Hi! The behavior sounds consistent with LOGCXX-162 (http:// issues.apache.org/jira/browse/LOGCXX-162?page=all) which was marked as resolved on 4-Dec-2006. Basically the charset decoder that called mbstowcs would go into a loop if the string contained a null character. However, the charset decoder in use depends on the platform and build settings and it is possible that the same defect exists in some of the other charset decoders. Could you let us know what platform and compiler you are using and any build switches. If you are using the ant build, did the unit test suite complete successfully. The bug fix for LOGCXX-162 added a test that should fail if the default character decoder has that type of flaw. I'm not sure if "make check" works on the autotools build to do the same thing. There was a recent patch that might have fixed it.
I believe that "a" was interpreted as being a char or wchar_t value, basically the same as if you did: "This is a number test: " + '\u0005'; in Java. If you increase the value of a to 67 or so, you'd should see an printable character in the log. That is a behavior that is built into std::basic_string and not much we can do about it.; log4cxx does contain a logstream class that was intended to make a std::basic_stream compatible logging interface, however there are some performance and usability issues around the current implementation and no obvious way to maintain full compatibility with std::basic_string and eliminate the performance problem. You could also create a formatting method that returned a std::string and use that in place of the message. The macros would short circuit the evaluation of the formatter if the threshold was not reached. Something like: LOG4CXX_DEBUG(logger, cfmt("This is a number test: %d", a));
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Possible error with logging a stringstream, Stephen Bartnikowski |
|---|---|
| Next by Date: | Re: missing stacktrace for jdbc appenders, Curt Arnold |
| Previous by Thread: | RE: Possible error with logging a stringstream, Stephen Bartnikowski |
| Next by Thread: | RE: Possible error with logging a stringstream, Tomas Andersen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |