You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2026/05/05 05:03:58 UTC

(logging-log4cxx) branch next_abi_layout created (now e105d2aa)

This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a change to branch next_abi_layout
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


      at e105d2aa Simplify the Layout interface in a future ABI version

This branch includes the following new commits:

     new e105d2aa Simplify the Layout interface in a future ABI version

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(logging-log4cxx) 01/01: Simplify the Layout interface in a future ABI version

Posted by sw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch next_abi_layout
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git

commit e105d2aaf0feabfda9ab12de31d36e758ec9823c
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Tue May 5 15:03:32 2026 +1000

    Simplify the Layout interface in a future ABI version
---
 src/main/cpp/htmllayout.cpp              |  8 ++----
 src/main/cpp/jsonlayout.cpp              | 16 +++++++----
 src/main/cpp/layout.cpp                  | 44 +++++++++++++++++++++++++++--
 src/main/cpp/patternlayout.cpp           |  4 +--
 src/main/cpp/simplelayout.cpp            |  4 +--
 src/main/cpp/smtpappender.cpp            |  6 ++--
 src/main/cpp/writerappender.cpp          |  4 +--
 src/main/cpp/xmllayout.cpp               |  4 +--
 src/main/include/log4cxx/htmllayout.h    | 19 +++++++++----
 src/main/include/log4cxx/jsonlayout.h    | 11 ++++++--
 src/main/include/log4cxx/layout.h        | 48 ++++++++++++++++++++++++++++++++
 src/main/include/log4cxx/patternlayout.h |  5 ++--
 src/main/include/log4cxx/simplelayout.h  | 11 ++++----
 src/main/include/log4cxx/xml/xmllayout.h |  7 ++---
 src/site/doxy/Doxyfile.in                |  3 ++
 src/test/cpp/jsonlayouttest.cpp          | 20 ++++---------
 src/test/cpp/xml/xmllayouttest.cpp       | 14 ++++------
 17 files changed, 157 insertions(+), 71 deletions(-)

diff --git a/src/main/cpp/htmllayout.cpp b/src/main/cpp/htmllayout.cpp
index 79d0992c..2655e0b4 100644
--- a/src/main/cpp/htmllayout.cpp
+++ b/src/main/cpp/htmllayout.cpp
@@ -80,9 +80,7 @@ void HTMLLayout::setOption(const LogString& option,
 	}
 }
 
-void HTMLLayout::format(LogString& output,
-	const spi::LoggingEventPtr& event,
-	Pool& p) const
+void HTMLLayout::format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const
 {
 	auto& lsMsg = event->getRenderedMessage();
 	output.reserve(m_priv->expectedPatternLength + lsMsg.size());
@@ -173,7 +171,7 @@ void HTMLLayout::format(LogString& output,
 	}
 }
 
-void HTMLLayout::appendHeader(LogString& output, Pool& p)
+void HTMLLayout::appendHeader( LOG4CXX_APPEND_HEADER_FORMAL_PARAMETERS )
 {
 	output.append(LOG4CXX_STR("<!DOCTYPE HTML PUBLIC "));
 	output.append(LOG4CXX_STR("\"-//W3C//DTD HTML 4.01 Transitional//EN\" "));
@@ -238,7 +236,7 @@ void HTMLLayout::appendHeader(LogString& output, Pool& p)
 	output.append(LOG4CXX_EOL);
 }
 
-void HTMLLayout::appendFooter(LogString& output, Pool& /* pool */ )
+void HTMLLayout::appendFooter( LOG4CXX_APPEND_FOOTER_FORMAL_PARAMETERS  )
 {
 	output.append(LOG4CXX_STR("</table>"));
 	output.append(LOG4CXX_EOL);
diff --git a/src/main/cpp/jsonlayout.cpp b/src/main/cpp/jsonlayout.cpp
index 98598fc9..b7da35c5 100644
--- a/src/main/cpp/jsonlayout.cpp
+++ b/src/main/cpp/jsonlayout.cpp
@@ -128,9 +128,7 @@ void JSONLayout::setOption(const LogString& option, const LogString& value)
 	}
 }
 
-void JSONLayout::format(LogString& output,
-	const spi::LoggingEventPtr& event,
-	Pool& p) const
+void JSONLayout::format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const
 {
 	auto& lsMsg = event->getRenderedMessage();
 	output.reserve(m_priv->expectedPatternLength + lsMsg.size());
@@ -197,7 +195,7 @@ void JSONLayout::format(LogString& output,
 	{
 		output.append(LOG4CXX_STR(","));
 		output.append(m_priv->prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
-		appendSerializedLocationInfo(output, event, p);
+		appendSerializedLocationInfo(output, event);
 	}
 
 	output.append(m_priv->prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
@@ -392,8 +390,7 @@ void JSONLayout::appendSerializedNDC(LogString& buf,
 	buf.append(LOG4CXX_STR("]"));
 }
 
-void JSONLayout::appendSerializedLocationInfo(LogString& buf,
-	const LoggingEventPtr& event, Pool& p) const
+void JSONLayout::appendSerializedLocationInfo(LogString& buf, const LoggingEventPtr& event) const
 {
 	if (m_priv->prettyPrint)
 	{
@@ -461,3 +458,10 @@ void JSONLayout::appendSerializedLocationInfo(LogString& buf,
 	buf.append(LOG4CXX_STR("}"));
 }
 
+#if LOG4CXX_ABI_VERSION <= 15
+void JSONLayout::appendSerializedLocationInfo(LogString& buf,
+	const LoggingEventPtr& event, Pool& p) const
+{
+	appendSerializedLocationInfo(buf, event);
+}
+#endif
diff --git a/src/main/cpp/layout.cpp b/src/main/cpp/layout.cpp
index c500907f..39eaf259 100644
--- a/src/main/cpp/layout.cpp
+++ b/src/main/cpp/layout.cpp
@@ -30,10 +30,51 @@ LogString Layout::getContentType() const
 	return LOG4CXX_STR("text/plain");
 }
 
+#if LOG4CXX_ABI_VERSION <= 15
+void Layout::format(LogString& output, const spi::LoggingEventPtr& event) const
+{
+	Pool p;
+	format(output, event, p);
+}
+
 void Layout::appendHeader(LogString&, LOG4CXX_NS::helpers::Pool&) {}
 
+void Layout::appendHeader(LogString& output)
+{
+	Pool p;
+	appendHeader(output, p);
+}
+
 void Layout::appendFooter(LogString&, LOG4CXX_NS::helpers::Pool&) {}
 
+void Layout::appendFooter(LogString& output)
+{
+	Pool p;
+	appendFooter(output, p);
+}
+#else
+void Layout::format(LogString& output, const spi::LoggingEventPtr& event, helpers::Pool&) const
+{
+	format(output, event);
+}
+
+void Layout::appendHeader(LogString& output, helpers::Pool&)
+{
+	appendHeader(output);
+}
+void Layout::appendHeader(LogString& output)
+{
+}
+
+void Layout::appendFooter(LogString& output, helpers::Pool&)
+{
+	appendFooter(output);
+}
+void Layout::appendFooter(LogString& output)
+{
+}
+#endif
+
 /**
  * The expected length of a formatted event excluding the message text
  */
@@ -46,8 +87,7 @@ size_t Layout::getFormattedEventCharacterCount() const
 		, LogString()
 		);
 	LogString text;
-	Pool pool;
-	format(text, exampleEvent, pool);
+	format(text, exampleEvent);
 	return text.size();
 }
 
diff --git a/src/main/cpp/patternlayout.cpp b/src/main/cpp/patternlayout.cpp
index e7bbe220..543fe9ab 100644
--- a/src/main/cpp/patternlayout.cpp
+++ b/src/main/cpp/patternlayout.cpp
@@ -111,9 +111,7 @@ void PatternLayout::setConversionPattern(const LogString& pattern)
 	activateOptions();
 }
 
-void PatternLayout::format(LogString& output,
-	const spi::LoggingEventPtr& event,
-	Pool& pool) const
+void PatternLayout::format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const
 {
 	auto& lsMsg = event->getRenderedMessage();
 	output.reserve(m_priv->expectedPatternLength + lsMsg.size());
diff --git a/src/main/cpp/simplelayout.cpp b/src/main/cpp/simplelayout.cpp
index 17e3b27c..a9e2a72a 100644
--- a/src/main/cpp/simplelayout.cpp
+++ b/src/main/cpp/simplelayout.cpp
@@ -26,9 +26,7 @@ IMPLEMENT_LOG4CXX_OBJECT(SimpleLayout)
 
 
 
-void SimpleLayout::format(LogString& output,
-	const spi::LoggingEventPtr& event,
-	LOG4CXX_NS::helpers::Pool&) const
+void SimpleLayout::format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const
 {
 	output.append(event->getLevel()->toString());
 	output.append(LOG4CXX_STR(" - "));
diff --git a/src/main/cpp/smtpappender.cpp b/src/main/cpp/smtpappender.cpp
index e9605c22..8f8543ad 100644
--- a/src/main/cpp/smtpappender.cpp
+++ b/src/main/cpp/smtpappender.cpp
@@ -732,17 +732,17 @@ void SMTPAppender::sendBuffer(Pool& p)
 	try
 	{
 		LogString sbuf;
-		_priv->layout->appendHeader(sbuf, p);
+		_priv->layout->appendHeader(sbuf);
 
 		int len = _priv->cb.length();
 
 		for (int i = 0; i < len; i++)
 		{
 			LoggingEventPtr event = _priv->cb.get();
-			_priv->layout->format(sbuf, event, p);
+			_priv->layout->format(sbuf, event);
 		}
 
-		_priv->layout->appendFooter(sbuf, p);
+		_priv->layout->appendFooter(sbuf);
 
 		SMTPSession session(_priv->smtpHost, _priv->smtpPort, _priv->smtpUsername, _priv->smtpPassword, p);
 
diff --git a/src/main/cpp/writerappender.cpp b/src/main/cpp/writerappender.cpp
index a55eb591..171dd4c8 100644
--- a/src/main/cpp/writerappender.cpp
+++ b/src/main/cpp/writerappender.cpp
@@ -255,7 +255,7 @@ void WriterAppender::WriterAppenderPriv::writeFooter()
 	{
 		Pool p;
 		LogString foot;
-		this->layout->appendFooter(foot, p);
+		this->layout->appendFooter(foot);
 		this->writer->write(foot, p);
 	}
 }
@@ -266,7 +266,7 @@ void WriterAppender::WriterAppenderPriv::writeHeader()
 	{
 		Pool p;
 		LogString header;
-		this->layout->appendHeader(header, p);
+		this->layout->appendHeader(header);
 		this->writer->write(header, p);
 	}
 }
diff --git a/src/main/cpp/xmllayout.cpp b/src/main/cpp/xmllayout.cpp
index 34677888..59ced7e0 100644
--- a/src/main/cpp/xmllayout.cpp
+++ b/src/main/cpp/xmllayout.cpp
@@ -74,9 +74,7 @@ void XMLLayout::setOption(const LogString& option,
 	}
 }
 
-void XMLLayout::format(LogString& output,
-	const spi::LoggingEventPtr& event,
-	Pool& p) const
+void XMLLayout::format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const
 {
 	auto& lsMsg = event->getRenderedMessage();
 	output.reserve(m_priv->expectedPatternLength + lsMsg.size());
diff --git a/src/main/include/log4cxx/htmllayout.h b/src/main/include/log4cxx/htmllayout.h
index 45b8a0e5..0643209b 100644
--- a/src/main/include/log4cxx/htmllayout.h
+++ b/src/main/include/log4cxx/htmllayout.h
@@ -78,6 +78,7 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout
 		*/
 		LogString getContentType() const override;
 
+		using Layout::activateOptions;
 #if LOG4CXX_ABI_VERSION <= 15
 		/**
 		\copybrief spi::OptionHandler::activateOptions()
@@ -96,18 +97,24 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout
 		*/
 		void setOption(const LogString& option, const LogString& value) override;
 
-		void format(LogString& output,
-			const spi::LoggingEventPtr& event, helpers::Pool& pool) const override;
+		using Layout::format;
+		/**
+		Append the attributes of \c event as a HTML table row onto \c output.
+		*/
+		void format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const override;
 
+		using Layout::appendHeader;
 		/**
-		Append appropriate HTML headers.
+		Append a HTML document header and start a HTML table with column headings
+		that align with the output produced by HTMLLayout::format.
 		*/
-		void appendHeader(LogString& output, helpers::Pool& pool) override;
+		void appendHeader( LOG4CXX_APPEND_HEADER_FORMAL_PARAMETERS ) override;
 
+		using Layout::appendFooter;
 		/**
-		Append the appropriate HTML footers.
+		Terminate the HTML table and the HTML document.
 		*/
-		void appendFooter(LogString& output, helpers::Pool& pool) override;
+		void appendFooter( LOG4CXX_APPEND_FOOTER_FORMAL_PARAMETERS ) override;
 
 		/**
 		The HTML layout handles the throwable contained in logging
diff --git a/src/main/include/log4cxx/jsonlayout.h b/src/main/include/log4cxx/jsonlayout.h
index 7d561f77..1ff923a2 100644
--- a/src/main/include/log4cxx/jsonlayout.h
+++ b/src/main/include/log4cxx/jsonlayout.h
@@ -39,9 +39,11 @@ class LOG4CXX_EXPORT JSONLayout : public Layout
 			const spi::LoggingEventPtr& event) const;
 		void appendSerializedNDC(LogString& buf,
 			const spi::LoggingEventPtr& event) const;
+		void appendSerializedLocationInfo(LogString& buf, const spi::LoggingEventPtr& event) const;
+#if LOG4CXX_ABI_VERSION <= 15
 		void appendSerializedLocationInfo(LogString& buf,
 			const spi::LoggingEventPtr& event, LOG4CXX_NS::helpers::Pool& p) const;
-
+#endif
 	public:
 		static void appendItem(const LogString& item, LogString& toAppendTo);
 		DECLARE_LOG4CXX_OBJECT(JSONLayout)
@@ -119,8 +121,11 @@ class LOG4CXX_EXPORT JSONLayout : public Layout
 		*/
 		void setOption(const LogString& option, const LogString& value) override;
 
-		void format(LogString& output,
-			const spi::LoggingEventPtr& event, helpers::Pool& pool) const override;
+		using Layout::format;
+		/**
+		Append the attributes of \c event as a JSON map onto \c output.
+		*/
+		void format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const override;
 
 		/**
 		The JSON layout handles the throwable contained in logging
diff --git a/src/main/include/log4cxx/layout.h b/src/main/include/log4cxx/layout.h
index a83759b8..6d45b720 100644
--- a/src/main/include/log4cxx/layout.h
+++ b/src/main/include/log4cxx/layout.h
@@ -48,8 +48,24 @@ class LOG4CXX_EXPORT Layout
 		/**
 		Implement this method to create your own layout format.
 		*/
+#if LOG4CXX_ABI_VERSION <= 15
+		void format(LogString& output, const spi::LoggingEventPtr& event) const;
+		/**
+		@deprecated The \c pool parameter is not used and will be removed in a future version.
+		Implement this method for now, but plan to migrate to format() without a helpers::Pool parameter.
+		*/
 		virtual void format(LogString& output,
 			const spi::LoggingEventPtr& event, LOG4CXX_NS::helpers::Pool& pool) const = 0;
+#define LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS LogString& output, const spi::LoggingEventPtr& event, helpers::Pool& p
+#else
+		virtual void format(LogString& output, const spi::LoggingEventPtr& event) const = 0;
+#define LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS LogString& output, const spi::LoggingEventPtr& event
+		/**
+		@deprecated The \c pool parameter is not used and will be removed in a future version.
+		*/
+		[[deprecated("Use format() without a Pool parameter instead")]]
+		void format(LogString& output, const spi::LoggingEventPtr& event, helpers::Pool& p) const;
+#endif
 
 		/**
 		Returns the content type output by this layout. The base class
@@ -61,13 +77,45 @@ class LOG4CXX_EXPORT Layout
 		Append the header for the layout format. The base class does
 		nothing.
 		*/
+#if LOG4CXX_ABI_VERSION <= 15
+		void appendHeader(LogString& output);
+		/**
+		@deprecated The \c pool parameter is not used and will be removed in a future version.
+		Implement this method for now, but plan to migrate to appendHeader() without a helpers::Pool parameter.
+		*/
 		virtual void appendHeader(LogString& output, LOG4CXX_NS::helpers::Pool& p);
+#define LOG4CXX_APPEND_HEADER_FORMAL_PARAMETERS LogString& output, LOG4CXX_NS::helpers::Pool& p
+#else
+		virtual void appendHeader(LogString& output);
+#define LOG4CXX_APPEND_HEADER_FORMAL_PARAMETERS LogString& output
+		/**
+		@deprecated The \c pool parameter is not used and will be removed in a future version.
+		*/
+		[[deprecated("Use appendHeader() without a Pool parameter instead")]]
+		void appendHeader(LogString& output, helpers::Pool& p);
+#endif
 
 		/**
 		Append the footer for the layout format. The base class does
 		nothing.
 		*/
+#if LOG4CXX_ABI_VERSION <= 15
+		void appendFooter(LogString& output);
+		/**
+		@deprecated The \c pool parameter is not used and will be removed in a future version.
+		Implement this method for now, but plan to migrate to appendFooter() without a helpers::Pool parameter.
+		*/
 		virtual void appendFooter(LogString& output, LOG4CXX_NS::helpers::Pool& p);
+#define LOG4CXX_APPEND_FOOTER_FORMAL_PARAMETERS LogString& output, LOG4CXX_NS::helpers::Pool& p
+#else
+		virtual void appendFooter(LogString& output);
+#define LOG4CXX_APPEND_FOOTER_FORMAL_PARAMETERS LogString& output
+		/**
+		@deprecated The \c pool parameter is not used and will be removed in a future version.
+		*/
+		[[deprecated("Use appendFooter() without a Pool parameter instead")]]
+		void appendFooter(LogString& output, helpers::Pool& p);
+#endif
 
 		/**
 		If the layout handles the throwable object contained within
diff --git a/src/main/include/log4cxx/patternlayout.h b/src/main/include/log4cxx/patternlayout.h
index 98820118..c7ce568e 100644
--- a/src/main/include/log4cxx/patternlayout.h
+++ b/src/main/include/log4cxx/patternlayout.h
@@ -523,12 +523,11 @@ class LOG4CXX_EXPORT PatternLayout : public Layout
 			return true;
 		}
 
+		using Layout::format;
 		/**
 		 * Produces a formatted string as specified by the conversion pattern.
 		 */
-		void format(    LogString& output,
-			const spi::LoggingEventPtr& event,
-			helpers::Pool& pool) const override;
+		void format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const override;
 
 	protected:
 		virtual LOG4CXX_NS::pattern::PatternMap getFormatSpecifiers();
diff --git a/src/main/include/log4cxx/simplelayout.h b/src/main/include/log4cxx/simplelayout.h
index f0fb2716..eb19e77d 100644
--- a/src/main/include/log4cxx/simplelayout.h
+++ b/src/main/include/log4cxx/simplelayout.h
@@ -44,14 +44,13 @@ class LOG4CXX_EXPORT SimpleLayout : public Layout
 		END_LOG4CXX_CAST_MAP()
 
 		/**
-		Returns the log statement in a format consisting of the
-		<code>level</code>, followed by " - " and then the
-		<code>message</code>. For example, <pre> INFO - "A message"
+		Append the <code>level</code>, followed by " - "
+		and then the <code>message</code>.
+		For example,
+		<pre> INFO - "A message"
 		</pre>
 		*/
-		void format(LogString& output,
-			const spi::LoggingEventPtr& event,
-			helpers::Pool& pool) const override;
+		void format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const override;
 
 		/**
 		The SimpleLayout does not handle the throwable contained within
diff --git a/src/main/include/log4cxx/xml/xmllayout.h b/src/main/include/log4cxx/xml/xmllayout.h
index f0ec5b09..f135f895 100644
--- a/src/main/include/log4cxx/xml/xmllayout.h
+++ b/src/main/include/log4cxx/xml/xmllayout.h
@@ -117,13 +117,12 @@ class LOG4CXX_EXPORT XMLLayout : public Layout
 		void setOption(const LogString& option,
 			const LogString& value) override;
 
+		using Layout::format;
 		/**
 		* Formats a {@link spi::LoggingEvent LoggingEvent}
-		* in conformance with the log4cxx.dtd.
+		* in conformance with [this XML data definition file](https://logging.apache.org/log4j/1.x/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd).
 		**/
-		void format(LogString& output,
-			const spi::LoggingEventPtr& event,
-			helpers::Pool& p) const override;
+		void format( LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS ) const override;
 
 		/**
 		The XMLLayout prints and does not ignore exceptions. Hence the
diff --git a/src/site/doxy/Doxyfile.in b/src/site/doxy/Doxyfile.in
index a1845656..24541615 100644
--- a/src/site/doxy/Doxyfile.in
+++ b/src/site/doxy/Doxyfile.in
@@ -2359,6 +2359,9 @@ PREDEFINED             = LOG4CXX_NS=log4cxx \
                          LOG4CXX_FORMAT_NUMBER_FORMAL_PARAMETERS="LogString& toAppendTo, int n, helpers::Pool& p" \
                          LOG4CXX_FORMAT_EVENT_FORMAL_PARAMETERS="const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p" \
                          LOG4CXX_FORMAT_EVENT_PARAMETERS="event, toAppendTo, p" \
+                         LOG4CXX_FORMAT_LAYOUT_FORMAL_PARAMETERS="LogString& output, const spi::LoggingEventPtr& event, helpers::Pool& p" \
+                         LOG4CXX_APPEND_HEADER_FORMAL_PARAMETERS="LogString& output, LOG4CXX_NS::helpers::Pool& p" \
+                         LOG4CXX_APPEND_FOOTER_FORMAL_PARAMETERS="LogString& output, LOG4CXX_NS::helpers::Pool& p" \
                          LOG4CXX_HAS_DOMCONFIGURATOR=1 \
                          LOG4CXX_ASYNC_BUFFER_SUPPORTS_FMT=1 \
                          __LOG4CXX_FUNC__=compiler_dependent
diff --git a/src/test/cpp/jsonlayouttest.cpp b/src/test/cpp/jsonlayouttest.cpp
index 0cb9d0d0..b375554b 100644
--- a/src/test/cpp/jsonlayouttest.cpp
+++ b/src/test/cpp/jsonlayouttest.cpp
@@ -300,8 +300,6 @@ public:
 	 */
 	void testAppendSerializedLocationInfo()
 	{
-		Pool p;
-
 		LoggingEventPtr event1 = LoggingEventPtr(new LoggingEvent(LOG4CXX_STR("Logger"),
 					Level::getInfo(),
 					LOG4CXX_STR("A message goes here."),
@@ -317,7 +315,7 @@ public:
 		.append(LOG4CXX_STR("\"class\": \"\", "))
 		.append(LOG4CXX_STR("\"method\": \"BarFunc\" }"));
 
-		appendSerializedLocationInfo(output1, event1, p);
+		appendSerializedLocationInfo(output1, event1);
 		LOGUNIT_ASSERT_EQUAL(expected1, output1);
 	}
 
@@ -326,8 +324,6 @@ public:
 	 */
 	void testAppendSerializedLocationInfoWithPrettyPrint()
 	{
-		Pool p;
-
 		LoggingEventPtr event1 = LoggingEventPtr(new LoggingEvent(LOG4CXX_STR("Logger"),
 					Level::getInfo(),
 					LOG4CXX_STR("A message goes here."),
@@ -356,7 +352,7 @@ public:
 		.append(LOG4CXX_STR("}"));
 
 		setPrettyPrint(true);
-		appendSerializedLocationInfo(output1, event1, p);
+		appendSerializedLocationInfo(output1, event1);
 
 		LOGUNIT_ASSERT_EQUAL(expected1, output1);
 	}
@@ -366,8 +362,6 @@ public:
 	 */
 	void testFormat()
 	{
-		Pool p;
-
 		LoggingEventPtr event1 = LoggingEventPtr(new LoggingEvent(LOG4CXX_STR("Logger"),
 					Level::getInfo(),
 					LOG4CXX_STR("A message goes here."),
@@ -400,11 +394,11 @@ public:
 		appendSerializedMDC(expected1, event1);
 		appendSerializedNDC(expected1, event1);
 		expected1.append(LOG4CXX_STR(", "));
-		appendSerializedLocationInfo(expected1, event1, p);
+		appendSerializedLocationInfo(expected1, event1);
 
 		expected1.append(LOG4CXX_STR(" }"));
 		expected1.append(LOG4CXX_EOL);
-		format(output1, event1, p);
+		format(output1, event1);
 
 		LOGUNIT_ASSERT_EQUAL(expected1, output1);
 	}
@@ -414,8 +408,6 @@ public:
 	 */
 	void testFormatWithPrettyPrint()
 	{
-		Pool p;
-
 		LoggingEventPtr event1 = LoggingEventPtr(new LoggingEvent(LOG4CXX_STR("Logger"),
 					Level::getInfo(),
 					LOG4CXX_STR("A message goes here."),
@@ -459,12 +451,12 @@ public:
 		appendSerializedNDC(expected1, event1);
 		expected1.append(LOG4CXX_STR(","));
 		expected1.append(LOG4CXX_EOL);
-		appendSerializedLocationInfo(expected1, event1, p);
+		appendSerializedLocationInfo(expected1, event1);
 
 		expected1.append(LOG4CXX_EOL);
 		expected1.append(LOG4CXX_STR("}"));
 		expected1.append(LOG4CXX_EOL);
-		format(output1, event1, p);
+		format(output1, event1);
 
 		LOGUNIT_ASSERT_EQUAL(expected1, output1);
 	}
diff --git a/src/test/cpp/xml/xmllayouttest.cpp b/src/test/cpp/xml/xmllayouttest.cpp
index 326fe940..5b20f2e4 100644
--- a/src/test/cpp/xml/xmllayouttest.cpp
+++ b/src/test/cpp/xml/xmllayouttest.cpp
@@ -115,9 +115,8 @@ public:
 	 */
 	void testGetHeader()
 	{
-		Pool p;
 		LogString header;
-		XMLLayout().appendHeader(header, p);
+		XMLLayout().appendHeader(header);
 		LOGUNIT_ASSERT_EQUAL((size_t) 0, header.size());
 	}
 
@@ -126,9 +125,8 @@ public:
 	 */
 	void testGetFooter()
 	{
-		Pool p;
 		LogString footer;
-		XMLLayout().appendFooter(footer, p);
+		XMLLayout().appendFooter(footer);
 		LOGUNIT_ASSERT_EQUAL((size_t) 0, footer.size());
 	}
 
@@ -282,7 +280,7 @@ public:
 		Pool p;
 		XMLLayout layout;
 		LogString result;
-		layout.format(result, event, p);
+		layout.format(result, event);
 		apr_xml_elem* parsedResult = parse(result, p);
 		checkEventElement(parsedResult, event);
 
@@ -316,7 +314,7 @@ public:
 		Pool p;
 		XMLLayout layout;
 		LogString result;
-		layout.format(result, event, p);
+		layout.format(result, event);
 		NDC::pop();
 
 		apr_xml_elem* parsedResult = parse(result, p);
@@ -398,7 +396,7 @@ public:
 		layout.setProperties(true);
 		Pool p;
 		LogString result;
-		layout.format(result, event, p);
+		layout.format(result, event);
 		MDC::clear();
 
 		apr_xml_elem* parsedResult = parse(result, p);
@@ -450,7 +448,7 @@ public:
 		XMLLayout layout;
 		Pool p;
 		LogString result;
-		layout.format(result, event, p);
+		layout.format(result, event);
 		NDC::clear();
 		apr_xml_elem* parsedResult = parse(result, p);
 		int ndcCount = 0;