You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by ts...@apache.org on 2015/10/08 18:59:02 UTC

svn commit: r1707585 - in /incubator/log4cxx/trunk/src/main: cpp/ include/log4cxx/ include/log4cxx/filter/ include/log4cxx/helpers/ include/log4cxx/nt/ include/log4cxx/xml/

Author: tschoening
Date: Thu Oct  8 16:59:02 2015
New Revision: 1707585

URL: http://svn.apache.org/viewvc?rev=1707585&view=rev
Log:
LOGCXX-456: My C++-Builder 10 Seattle seems to wrongly remove getters and setters which are not used in the static lib itself, but e.g. only in tests, if they are defined in the header. I'm not sure how to handle this properly, but moving the definition to the CPP implementation file of a class seems to resolve this issue, so I'm doing that for now, because it shouldn't harm anyone. If it does, we can easily revert and document the problem further in the ticket.

Modified:
    incubator/log4cxx/trunk/src/main/cpp/appenderskeleton.cpp
    incubator/log4cxx/trunk/src/main/cpp/cyclicbuffer.cpp
    incubator/log4cxx/trunk/src/main/cpp/levelmatchfilter.cpp
    incubator/log4cxx/trunk/src/main/cpp/levelrangefilter.cpp
    incubator/log4cxx/trunk/src/main/cpp/loggermatchfilter.cpp
    incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp
    incubator/log4cxx/trunk/src/main/cpp/stringmatchfilter.cpp
    incubator/log4cxx/trunk/src/main/cpp/xmllayout.cpp
    incubator/log4cxx/trunk/src/main/include/log4cxx/appenderskeleton.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelmatchfilter.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelrangefilter.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/filter/loggermatchfilter.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/filter/stringmatchfilter.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/cyclicbuffer.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/datetimedateformat.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/nt/nteventlogappender.h
    incubator/log4cxx/trunk/src/main/include/log4cxx/xml/xmllayout.h

Modified: incubator/log4cxx/trunk/src/main/cpp/appenderskeleton.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/appenderskeleton.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/appenderskeleton.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/appenderskeleton.cpp Thu Oct  8 16:59:02 2015
@@ -39,7 +39,7 @@ AppenderSkeleton::AppenderSkeleton()
     errorHandler(new OnlyOnceErrorHandler()),
     headFilter(),
     tailFilter(),
-    pool(), 
+    pool(),
     mutex(pool)
 {
     synchronized sync(mutex);
@@ -100,6 +100,16 @@ void AppenderSkeleton::clearFilters()
         headFilter = tailFilter = 0;
 }
 
+const spi::ErrorHandlerPtr& AppenderSkeleton::getErrorHandler() const
+{
+    return errorHandler;
+}
+
+const LevelPtr& AppenderSkeleton::getThreshold() const
+{
+    return threshold;
+}
+
 bool AppenderSkeleton::isAsSevereAsThreshold(const LevelPtr& level) const
 {
         return ((level == 0) || level->isGreaterOrEqual(threshold));

Modified: incubator/log4cxx/trunk/src/main/cpp/cyclicbuffer.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/cyclicbuffer.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/cyclicbuffer.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/cyclicbuffer.cpp Thu Oct  8 16:59:02 2015
@@ -103,6 +103,16 @@ spi::LoggingEventPtr CyclicBuffer::get()
         return r;
 }
 
+int CyclicBuffer::getMaxSize() const
+{
+    return maxSize;
+}
+
+int CyclicBuffer::length() const
+{
+    return numElems;
+}
+
 /**
 Resize the cyclic buffer to <code>newSize</code>.
 @throws IllegalArgumentException if <code>newSize</code> is negative.

Modified: incubator/log4cxx/trunk/src/main/cpp/levelmatchfilter.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/levelmatchfilter.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/levelmatchfilter.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/levelmatchfilter.cpp Thu Oct  8 16:59:02 2015
@@ -62,6 +62,11 @@ LogString LevelMatchFilter::getLevelToMa
    return levelToMatch->toString();
 }
 
+void LevelMatchFilter::setAcceptOnMatch(bool acceptOnMatch1)
+{
+    this->acceptOnMatch = acceptOnMatch1;
+}
+
 Filter::FilterDecision LevelMatchFilter::decide(
    const log4cxx::spi::LoggingEventPtr& event) const
 {

Modified: incubator/log4cxx/trunk/src/main/cpp/levelrangefilter.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/levelrangefilter.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/levelrangefilter.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/levelrangefilter.cpp Thu Oct  8 16:59:02 2015
@@ -56,6 +56,21 @@ void LevelRangeFilter::setOption(const L
    }
 }
 
+void LevelRangeFilter::setLevelMin(const LevelPtr& levelMin1)
+{
+    this->levelMin = levelMin1;
+}
+
+void LevelRangeFilter::setLevelMax(const LevelPtr& levelMax1)
+{
+    this->levelMax = levelMax1;
+}
+
+void LevelRangeFilter::setAcceptOnMatch(bool acceptOnMatch1)
+{
+    this->acceptOnMatch = acceptOnMatch1;
+}
+
 Filter::FilterDecision LevelRangeFilter::decide(
    const spi::LoggingEventPtr& event) const
 {

Modified: incubator/log4cxx/trunk/src/main/cpp/loggermatchfilter.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/loggermatchfilter.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/loggermatchfilter.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/loggermatchfilter.cpp Thu Oct  8 16:59:02 2015
@@ -42,6 +42,11 @@ LogString LoggerMatchFilter::getLoggerTo
     return loggerToMatch;
 }
 
+void LoggerMatchFilter::setAcceptOnMatch(bool acceptOnMatch1)
+{
+    this->acceptOnMatch = acceptOnMatch1;
+}
+
 void LoggerMatchFilter::setOption(const LogString& option,
    const LogString& value)
 {

Modified: incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp Thu Oct  8 16:59:02 2015
@@ -142,6 +142,11 @@ void NTEventLogAppender::setOption(const
         }
 }
 
+void NTEventLogAppender::setSource(const LogString& source)
+{
+    this->source.assign(source);
+}
+
 void NTEventLogAppender::activateOptions(Pool&)
 {
         if (source.empty())

Modified: incubator/log4cxx/trunk/src/main/cpp/stringmatchfilter.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/stringmatchfilter.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/stringmatchfilter.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/stringmatchfilter.cpp Thu Oct  8 16:59:02 2015
@@ -50,6 +50,16 @@ void StringMatchFilter::setOption(const
    }
 }
 
+void StringMatchFilter::setStringToMatch(const LogString& stringToMatch1)
+{
+    this->stringToMatch.assign(stringToMatch1);
+}
+
+void StringMatchFilter::setAcceptOnMatch(bool acceptOnMatch1)
+{
+    this->acceptOnMatch = acceptOnMatch1;
+}
+
 Filter::FilterDecision StringMatchFilter::decide(
    const log4cxx::spi::LoggingEventPtr& event) const
 {

Modified: incubator/log4cxx/trunk/src/main/cpp/xmllayout.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/xmllayout.cpp?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/xmllayout.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/xmllayout.cpp Thu Oct  8 16:59:02 2015
@@ -39,6 +39,11 @@ XMLLayout::XMLLayout()
 {
 }
 
+bool XMLLayout::getLocationInfo() const
+{
+	return locationInfo;
+}
+
 void XMLLayout::setOption(const LogString& option,
         const LogString& value)
 {
@@ -99,7 +104,7 @@ void XMLLayout::format(LogString& output
                 output.append(LOG4CXX_STR("\"/>"));
                 output.append(LOG4CXX_EOL);
         }
-        
+
         if (properties) {
             LoggingEvent::KeySet propertySet(event->getPropertyKeySet());
             LoggingEvent::KeySet keySet(event->getMDCKeySet());
@@ -107,7 +112,7 @@ void XMLLayout::format(LogString& output
                 output.append(LOG4CXX_STR("<log4j:properties>"));
                 output.append(LOG4CXX_EOL);
                 for (LoggingEvent::KeySet::const_iterator i = keySet.begin();
-                        i != keySet.end(); 
+                        i != keySet.end();
                         i++) {
                         LogString key(*i);
                         LogString value;
@@ -121,7 +126,7 @@ void XMLLayout::format(LogString& output
                         }
                 }
             for (LoggingEvent::KeySet::const_iterator i2 = propertySet.begin();
-                        i2 != propertySet.end(); 
+                        i2 != propertySet.end();
                         i2++) {
                         LogString key(*i2);
                         LogString value;
@@ -141,6 +146,6 @@ void XMLLayout::format(LogString& output
 
         output.append(LOG4CXX_STR("</log4j:event>"));
         output.append(LOG4CXX_EOL);
-        output.append(LOG4CXX_EOL);        
+        output.append(LOG4CXX_EOL);
 }
 

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/appenderskeleton.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/appenderskeleton.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/appenderskeleton.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/appenderskeleton.h Thu Oct  8 16:59:02 2015
@@ -127,7 +127,7 @@ namespace log4cxx
                 Return the currently set spi::ErrorHandler for this
                 Appender.
                 */
-                const spi::ErrorHandlerPtr& getErrorHandler() const { return errorHandler; }
+                const spi::ErrorHandlerPtr& getErrorHandler() const;
 
                 /**
                 Returns the head Filter.
@@ -156,7 +156,7 @@ namespace log4cxx
                 Returns this appenders threshold level. See the #setThreshold
                 method for the meaning of this option.
                 */
-                const LevelPtr& getThreshold() { return threshold; }
+                const LevelPtr& getThreshold() const;
 
                 /**
                 Check whether the message level is below the appender's

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelmatchfilter.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelmatchfilter.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelmatchfilter.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelmatchfilter.h Thu Oct  8 16:59:02 2015
@@ -72,8 +72,7 @@ namespace log4cxx
 
                         LogString getLevelToMatch() const;
 
-                        inline void setAcceptOnMatch(bool acceptOnMatch1)
-                                { this->acceptOnMatch = acceptOnMatch1; }
+                        void setAcceptOnMatch(bool acceptOnMatch1);
 
                         inline bool getAcceptOnMatch() const
                                 { return acceptOnMatch; }

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelrangefilter.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelrangefilter.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelrangefilter.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/filter/levelrangefilter.h Thu Oct  8 16:59:02 2015
@@ -84,8 +84,7 @@ namespace log4cxx
                         /**
                         Set the <code>LevelMin</code> option.
                         */
-                        void setLevelMin(const LevelPtr& levelMin1)
-                                { this->levelMin = levelMin1; }
+                        void setLevelMin(const LevelPtr& levelMin1);
 
                         /**
                         Get the value of the <code>LevelMin</code> option.
@@ -96,8 +95,7 @@ namespace log4cxx
                         /**
                         Set the <code>LevelMax</code> option.
                         */
-                        void setLevelMax(const LevelPtr& levelMax1)
-                                { this->levelMax = levelMax1; }
+                        void setLevelMax(const LevelPtr& levelMax1);
 
                         /**
                         Get the value of the <code>LevelMax</code> option.
@@ -108,8 +106,7 @@ namespace log4cxx
                         /**
                         Set the <code>AcceptOnMatch</code> option.
                         */
-                        inline void setAcceptOnMatch(bool acceptOnMatch1)
-                                { this->acceptOnMatch = acceptOnMatch1; }
+                        void setAcceptOnMatch(bool acceptOnMatch1);
 
                         /**
                         Get the value of the <code>AcceptOnMatch</code> option.

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/filter/loggermatchfilter.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/filter/loggermatchfilter.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/filter/loggermatchfilter.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/filter/loggermatchfilter.h Thu Oct  8 16:59:02 2015
@@ -74,8 +74,7 @@ namespace log4cxx
 
                         LogString getLoggerToMatch() const;
 
-                        inline void setAcceptOnMatch(bool acceptOnMatch1)
-                                { this->acceptOnMatch = acceptOnMatch1; }
+                        void setAcceptOnMatch(bool acceptOnMatch1);
 
                         inline bool getAcceptOnMatch() const
                                 { return acceptOnMatch; }

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/filter/stringmatchfilter.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/filter/stringmatchfilter.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/filter/stringmatchfilter.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/filter/stringmatchfilter.h Thu Oct  8 16:59:02 2015
@@ -67,14 +67,12 @@ namespace log4cxx
                         virtual void setOption(const LogString& option,
                                 const LogString& value);
 
-                        inline void setStringToMatch(const LogString& stringToMatch1)
-                                { this->stringToMatch.assign(stringToMatch1); }
+                        void setStringToMatch(const LogString& stringToMatch1);
 
                         inline const LogString& getStringToMatch() const
                                 { return stringToMatch; }
 
-                        inline void setAcceptOnMatch(bool acceptOnMatch1)
-                                { this->acceptOnMatch = acceptOnMatch1; }
+                        void setAcceptOnMatch(bool acceptOnMatch1);
 
                         inline bool getAcceptOnMatch() const
                                 { return acceptOnMatch; }

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/cyclicbuffer.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/cyclicbuffer.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/cyclicbuffer.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/cyclicbuffer.h Thu Oct  8 16:59:02 2015
@@ -26,7 +26,7 @@ namespace log4cxx
         {
                 /**
                 CyclicBuffer is used by other appenders to hold instances of
-                {@link log4cxx::spi::LoggingEvent LoggingEvent} for immediate 
+                {@link log4cxx::spi::LoggingEvent LoggingEvent} for immediate
                 or deferred display.
                 <p>This buffer gives read access to any element in the buffer not
                 just the first or last element.
@@ -63,8 +63,7 @@ namespace log4cxx
                         */
                         spi::LoggingEventPtr get(int i);
 
-                        int getMaxSize() const
-                                { return maxSize; }
+                        int getMaxSize() const;
 
                         /**
                         Get the oldest (first) element in the buffer. The oldest element
@@ -77,8 +76,7 @@ namespace log4cxx
                         guaranteed to be in the range 0 to <code>maxSize</code>
                         (inclusive).
                         */
-                        int length() const
-                                { return numElems; }
+                        int length() const;
 
                         /**
                         Resize the cyclic buffer to <code>newSize</code>.

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/datetimedateformat.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/datetimedateformat.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/datetimedateformat.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/helpers/datetimedateformat.h Thu Oct  8 16:59:02 2015
@@ -31,9 +31,7 @@ namespace log4cxx
                 class LOG4CXX_EXPORT DateTimeDateFormat : public SimpleDateFormat
                 {
                 public:
-                        DateTimeDateFormat()
-                         : SimpleDateFormat(LOG4CXX_STR("dd MMM yyyy HH:mm:ss,SSS")) {}
-                         DateTimeDateFormat(const std::locale* locale)
+                         DateTimeDateFormat(const std::locale* locale = NULL)
                           : SimpleDateFormat(LOG4CXX_STR("dd MMM yyyy HH:mm:ss,SSS"), locale) {}
                 };
         }  // namespace helpers

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/nt/nteventlogappender.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/nt/nteventlogappender.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/nt/nteventlogappender.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/nt/nteventlogappender.h Thu Oct  8 16:59:02 2015
@@ -55,8 +55,7 @@ namespace log4cxx
                          bool requiresLayout() const
                                 { return true; }
 
-                        void setSource(const LogString& source)
-                                { this->source.assign(source); }
+                        void setSource(const LogString& source);
 
                         const LogString& getSource() const
                                 { return source; }

Modified: incubator/log4cxx/trunk/src/main/include/log4cxx/xml/xmllayout.h
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/include/log4cxx/xml/xmllayout.h?rev=1707585&r1=1707584&r2=1707585&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/include/log4cxx/xml/xmllayout.h (original)
+++ incubator/log4cxx/trunk/src/main/include/log4cxx/xml/xmllayout.h Thu Oct  8 16:59:02 2015
@@ -84,13 +84,12 @@ namespace log4cxx
                                 /**
                         Returns the current value of the <b>LocationInfo</b> option.
                         */
-                        inline bool getLocationInfo() const
-                                { return locationInfo; }
-                                
+                        bool getLocationInfo() const;
+
                         /**
                          * Sets whether MDC key-value pairs should be output, default false.
                          * @param flag new value.
-                         * 
+                         *
                         */
                         inline void setProperties(bool flag) {
                             properties = flag;
@@ -99,12 +98,12 @@ namespace log4cxx
                         /**
                         * Gets whether MDC key-value pairs should be output.
                         * @return true if MDC key-value pairs are output.
-                        * 
+                        *
                         */
                         inline bool getProperties() {
                             return properties;
                         }
-                              
+
 
                         /** No options to activate. */
                         void activateOptions(log4cxx::helpers::Pool& /* p */) { }