Hi,
I intend to commit the following patch to solve issue
http://issues.apache.org/jira/browse/LOGCXX-82
Index: include/log4cxx/stream.h
===================================================================
--- include/log4cxx/stream.h (Revision 332794)
+++ include/log4cxx/stream.h (Arbeitskopie)
@@ -147,60 +147,37 @@
} // namespace log4cxx
+
#if LOG4CXX_HAS_WCHAR_T
log4cxx::logstream& operator<<(
::log4cxx::logstream& lhs,
- const char* rhs) {
- LOG4CXX_DECODE_CHAR(tmp, rhs);
- LOG4CXX_ENCODE_WCHAR(msg, tmp);
- lhs.getStream() << msg;
- return lhs;
-}
+ const char* rhs);
#else
log4cxx::logstream& operator<<(
::log4cxx::logstream& lhs,
- const char* rhs) {
- LOG4CXX_DECODE_CHAR(tmp, rhs);
- LOG4CXX_ENCODE_CHAR(msg, tmp);
- lhs.getStream() << msg;
- return lhs;
-}
+ const char* rhs);
#endif
-
::log4cxx::logstream& operator<<(
::log4cxx::logstream& lhs,
- const ::log4cxx::spi::LocationInfo& rhs) {
- lhs.setLocation(rhs);
- return lhs;
-}
+ const ::log4cxx::spi::LocationInfo& rhs);
::log4cxx::logstream& operator<<(
::log4cxx::logstream& lhs,
- const ::log4cxx::spi::LocationFlush& rhs) {
- lhs.flush(rhs);
- return lhs;
-}
+ const ::log4cxx::spi::LocationFlush& rhs);
+
::log4cxx::logstream& operator<<(
::log4cxx::logstream& lhs,
- const ::log4cxx::LevelPtr& rhs) {
- lhs.setLevel(rhs);
- return lhs;
-}
+ const ::log4cxx::LevelPtr& rhs);
::log4cxx::logstream& operator<<(
::log4cxx::logstream& lhs,
- ::std::ios_base& (*manip)(::std::ios_base&)) {
- (*manip)(lhs);
- return lhs;
-}
+ ::std::ios_base& (*manip)(::std::ios_base&));
-
-
//
// template for all other insertion operators
//
@@ -214,6 +191,7 @@
return lhs;
}
+
#if !defined(LOG4CXX_ENDMSG)
#define LOG4CXX_ENDMSG LOG4CXX_LOCATION_FLUSH
#endif
Index: src/Makefile.am
===================================================================
--- src/Makefile.am (Revision 332794)
+++ src/Makefile.am (Arbeitskopie)
@@ -68,6 +68,7 @@
loggingevent.cpp \
loglog.cpp \
logmanager.cpp \
+ logstream.cpp \
manualtriggeringpolicy.cpp \
messagepatternconverter.cpp \
methodlocationpatternconverter.cpp \
Index: src/logstream.cpp
===================================================================
--- src/logstream.cpp (Revision 0)
+++ src/logstream.cpp (Revision 0)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <log4cxx/stream.h>
+
+#if LOG4CXX_HAS_WCHAR_T
+log4cxx::logstream& operator<<(
+ ::log4cxx::logstream& lhs,
+ const char* rhs) {
+ LOG4CXX_DECODE_CHAR(tmp, rhs);
+ LOG4CXX_ENCODE_WCHAR(msg, tmp);
+ lhs.getStream() << msg;
+ return lhs;
+}
+#else
+log4cxx::logstream& operator<<(
+ ::log4cxx::logstream& lhs,
+ const char* rhs) {
+ LOG4CXX_DECODE_CHAR(tmp, rhs);
+ LOG4CXX_ENCODE_CHAR(msg, tmp);
+ lhs.getStream() << msg;
+ return lhs;
+}
+#endif
+
+::log4cxx::logstream& operator<<(
+ ::log4cxx::logstream& lhs,
+ const ::log4cxx::spi::LocationInfo& rhs) {
+ lhs.setLocation(rhs);
+ return lhs;
+}
+
+
+::log4cxx::logstream& operator<<(
+ ::log4cxx::logstream& lhs,
+ const ::log4cxx::spi::LocationFlush& rhs) {
+ lhs.flush(rhs);
+ return lhs;
+}
+
+::log4cxx::logstream& operator<<(
+ ::log4cxx::logstream& lhs,
+ const ::log4cxx::LevelPtr& rhs) {
+ lhs.setLevel(rhs);
+ return lhs;
+}
+
+
+::log4cxx::logstream& operator<<(
+ ::log4cxx::logstream& lhs,
+ ::std::ios_base& (*manip)(::std::ios_base&)) {
+ (*manip)(lhs);
+ return lhs;
+}