You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by "Steck, David" <da...@lmco.com> on 2005/07/22 18:57:07 UTC

Using logstream with std::string

Hi all,

I am just starting to use log4cxx and happened across the logstream class.  This seems like a wonderful idea (vs. fixed string macros).  Unless there are reasons I don't know about, I intend to use this class to replace all my cout statements, and I'll skip using the standard macros all together.

But, looking a little at the mailing list archives, it sounds like there are still issues with the logstream class.  In particular, I've run into the same problem outputting strings that was described in the messages sent 6/6/05 and 6/7/05, with subject "Status of stream.h?".

My approach has been to append .c_str() to all my strings, which works fine, but I don't know what the consequences (performance, etc.) of this are, and it feels like a kludge.

Has any progress been made in this area?  Has anyone written a function to allow strings to be output with logstream?

Thanks in advance,
-David


BTW, I agree with Andreas' suggestion to rename stream.h to logstream.h.  In my case, it would have helped me find the source file, logstream.cpp, more easily.

Also, I would currently prefer to use logstream over a parameterized printf()-style function call.