logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steck, David" <david.st...@lmco.com>
Subject Using logstream with std::string
Date Fri, 22 Jul 2005 16:57:07 GMT
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.


Mime
View raw message