Index: include/log4cxx/stream.h =================================================================== --- include/log4cxx/stream.h (revision 397231) +++ include/log4cxx/stream.h (working copy) @@ -152,6 +152,10 @@ const char* rhs); LOG4CXX_EXPORT ::log4cxx::logstream& operator<<( + ::log4cxx::logstream& lhs, + const std::string& rhs); + +LOG4CXX_EXPORT ::log4cxx::logstream& operator<<( ::log4cxx::logstream& lhs, const ::log4cxx::LogString& rhs); Index: src/logstream.cpp =================================================================== --- src/logstream.cpp (revision 397231) +++ src/logstream.cpp (working copy) @@ -40,6 +40,26 @@ #if LOG4CXX_HAS_WCHAR_T log4cxx::logstream& operator<<( ::log4cxx::logstream& lhs, + const std::string& rhs) { + LOG4CXX_DECODE_CHAR(tmp, rhs); + LOG4CXX_ENCODE_WCHAR(msg, tmp); + lhs.getStream() << msg; + return lhs; +} +#else +log4cxx::logstream& operator<<( + ::log4cxx::logstream& lhs, + const std::string& rhs) { + LOG4CXX_DECODE_CHAR(tmp, rhs); + LOG4CXX_ENCODE_CHAR(msg, tmp); + lhs.getStream() << msg; + return lhs; +} +#endif + +#if LOG4CXX_HAS_WCHAR_T +log4cxx::logstream& operator<<( + ::log4cxx::logstream& lhs, const ::log4cxx::LogString& rhs) { LOG4CXX_DECODE_CHAR(tmp, rhs); LOG4CXX_ENCODE_WCHAR(msg, tmp);