[bind10-dev] in order to build bind10-20120517 against log4cplus-1.1.0-rc5
John Lumby
jlumby at bluecatnetworks.com
Wed Aug 1 21:46:09 UTC 2012
I also appended the log4cplus-dev today before noticing your append :-)
Does bind10 need to be able to build against log4cplus-1.0.x?
John
________________________________________
From: Jeremy C. Reed [jreed at isc.org]
Sent: Monday, July 30, 2012 5:35 PM
To: John Lumby
Cc: bind10-dev at lists.isc.org
Subject: Re: [bind10-dev] in order to build bind10-20120517 against log4cplus-1.1.0-rc5
On Wed, 6 Jun 2012, John Lumby wrote:
> Thanks. So here is the corrected patch:
>
> --- src/lib/log/logger_impl.cc.orig 2011-11-02 09:46:32.000000000 -0400
> +++ src/lib/log/logger_impl.cc 2012-06-05 12:59:12.716099530 -0400
> @@ -22,6 +22,7 @@
> #include <boost/static_assert.hpp>
>
> #include <log4cplus/configurator.h>
> +#include <log4cplus/loggingmacros.h>
>
> #include <log/logger.h>
> #include <log/logger_impl.h>
> --- src/lib/log/logger_level_impl.cc.orig 2011-11-02 09:46:32.000000000 -0400
> +++ src/lib/log/logger_level_impl.cc 2012-06-06 17:29:42.508800849 -0400
> @@ -185,20 +185,24 @@ LoggerLevelImpl::logLevelFromString(cons
>
> // Convert logging level to string. If the level is a valid debug level,
> // return the string DEBUG, else return the empty string.
> -log4cplus::tstring
> +log4cplus::tstring const &
> LoggerLevelImpl::logLevelToString(log4cplus::LogLevel level) {
> +
> + static const tstring debug_string("DEBUG");
> + static const tstring empty_string;
> +
> Level bindlevel = convertToBindLevel(level);
> Severity& severity = bindlevel.severity;
> int& dbglevel = bindlevel.dbglevel;
>
> if ((severity == DEBUG) &&
> ((dbglevel >= MIN_DEBUG_LEVEL) && (dbglevel <= MAX_DEBUG_LEVEL))) {
> - return (tstring("DEBUG"));
> + return (debug_string);
> }
>
> // Unknown, so return empty string for log4cplus to try other conversion
> // functions.
> - return (tstring());
> + return (empty_string);
> }
>
> // Initialization. Register the conversion functions with the LogLevelManager.
> --- src/lib/log/logger_level_impl.h.orig 2012-03-19 14:55:01.000000000 -0400
> +++ src/lib/log/logger_level_impl.h 2012-06-05 15:21:00.004301737 -0400
> @@ -112,7 +112,7 @@ public:
> /// \param level Extended logging level
> ///
> /// \return Equivalent string.
> - static log4cplus::tstring logLevelToString(log4cplus::LogLevel level);
> + static log4cplus::tstring const & logLevelToString(log4cplus::LogLevel level);
>
> /// \brief Initialize extended logging levels
> ///
> --- src/lib/log/logger_manager_impl.cc.orig 2012-05-08 12:55:34.000000000 -0400
> +++ src/lib/log/logger_manager_impl.cc 2012-06-05 15:27:38.864311183 -0400
> @@ -17,6 +17,7 @@
>
> #include <log4cplus/logger.h>
> #include <log4cplus/configurator.h>
> +#include <log4cplus/hierarchy.h>
> #include <log4cplus/consoleappender.h>
> #include <log4cplus/fileappender.h>
> #include <log4cplus/syslogappender.h>
I created a ticket for this work at
http://bind10.isc.org/ticket/2169
The above patch worked for 1.1.0-rc6, but doesn't work with 1.0.4 for
me.
libtool: compile: /home/reed/bin/ccache-c++ -DHAVE_CONFIG_H -I.
-I../../.. -I../../../src/lib -I../../../src/lib -I/usr/pkg/include
-DTOP_BUILDDIR=\"/home/reed/work/isc/bind10/git/bind10\"
-I/usr/pkg/include -DOS_BSD -I../../../ext/asio -I../../../ext/coroutine
-DASIO_DISABLE_THREADS=1 -Wno-unused-parameter -g -O2 -MT
liblog_la-logger_level_impl.lo -MD -MP -MF
.deps/liblog_la-logger_level_impl.Tpo -c logger_level_impl.cc -fPIC
-DPIC -o .libs/liblog_la-logger_level_impl.o
logger_level_impl.cc: In static member function 'static void
isc::log::LoggerLevelImpl::init()':
logger_level_impl.cc:217: error: invalid conversion from 'const
log4cplus::tstring& (*)(log4cplus::LogLevel)' to 'log4cplus::tstring
(*)(log4cplus::LogLevel)'
logger_level_impl.cc:217: error: initializing argument 1 of 'void
log4cplus::LogLevelManager::pushToStringMethod(log4cplus::tstring
(*)(log4cplus::LogLevel))'
*** Error code 1
I didn't look at this yet. But I wonder if the 1.1.x is supposed to be
compatible with 1.0.x branch.
Thank you for your patches.
More information about the bind10-dev
mailing list