You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ts...@apache.org on 2019/10/22 19:59:27 UTC

[logging-log4cxx] 01/02: Replaced "\n" with LOG4CXX_EOL, because that was used in one place already and broke tests on Windows this way. HTMLLayout used that only and with now using that only the tests succeed on Windows.

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

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

commit 753797ac448f96b00777d20e92b4a1428aba857b
Author: Thorsten Schöning <ts...@am-soft.de>
AuthorDate: Tue Oct 22 21:57:40 2019 +0200

    Replaced "\n" with LOG4CXX_EOL, because that was used in one place already and broke tests on Windows this way. HTMLLayout used that only and with now using that only the tests succeed on Windows.
---
 src/main/cpp/jsonlayout.cpp | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/main/cpp/jsonlayout.cpp b/src/main/cpp/jsonlayout.cpp
index 816c8d2..a2e72c3 100644
--- a/src/main/cpp/jsonlayout.cpp
+++ b/src/main/cpp/jsonlayout.cpp
@@ -64,7 +64,7 @@ void JSONLayout::format(LogString& output,
 	Pool& p) const
 {
 	output.append(LOG4CXX_STR("{"));
-	output.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	output.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -77,7 +77,7 @@ void JSONLayout::format(LogString& output,
 	dateFormat.format(timestamp, event->getTimeStamp(), p);
 	appendQuotedEscapedString(output, timestamp);
 	output.append(LOG4CXX_STR(","));
-	output.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	output.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -90,7 +90,7 @@ void JSONLayout::format(LogString& output,
 	event->getLevel()->toString(level);
 	appendQuotedEscapedString(output, level);
 	output.append(LOG4CXX_STR(","));
-	output.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	output.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -101,7 +101,7 @@ void JSONLayout::format(LogString& output,
 	output.append(LOG4CXX_STR(": "));
 	appendQuotedEscapedString(output, event->getLoggerName());
 	output.append(LOG4CXX_STR(","));
-	output.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	output.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -118,11 +118,11 @@ void JSONLayout::format(LogString& output,
 	if (locationInfo)
 	{
 		output.append(LOG4CXX_STR(","));
-		output.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+		output.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 		appendSerializedLocationInfo(output, event, p);
 	}
 
-	output.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	output.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 	output.append(LOG4CXX_STR("}"));
 	output.append(LOG4CXX_EOL);
 }
@@ -235,7 +235,7 @@ void JSONLayout::appendSerializedMDC(LogString& buf,
 	}
 
 	buf.append(LOG4CXX_STR(","));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -244,7 +244,7 @@ void JSONLayout::appendSerializedMDC(LogString& buf,
 
 	appendQuotedEscapedString(buf, LOG4CXX_STR("context_map"));
 	buf.append(LOG4CXX_STR(": {"));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	for (LoggingEvent::KeySet::iterator it = keys.begin();
 		it != keys.end(); ++it)
@@ -264,11 +264,11 @@ void JSONLayout::appendSerializedMDC(LogString& buf,
 		if (it + 1 != keys.end())
 		{
 			buf.append(LOG4CXX_STR(","));
-			buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+			buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 		}
 		else
 		{
-			buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+			buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 		}
 	}
 
@@ -291,7 +291,7 @@ void JSONLayout::appendSerializedNDC(LogString& buf,
 	}
 
 	buf.append(LOG4CXX_STR(","));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -300,7 +300,7 @@ void JSONLayout::appendSerializedNDC(LogString& buf,
 
 	appendQuotedEscapedString(buf, LOG4CXX_STR("context_stack"));
 	buf.append(LOG4CXX_STR(": ["));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -308,7 +308,7 @@ void JSONLayout::appendSerializedNDC(LogString& buf,
 	}
 
 	appendQuotedEscapedString(buf, ndcVal);
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -328,7 +328,7 @@ void JSONLayout::appendSerializedLocationInfo(LogString& buf,
 
 	appendQuotedEscapedString(buf, LOG4CXX_STR("location_info"));
 	buf.append(LOG4CXX_STR(": {"));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 	const LocationInfo& locInfo = event->getLocationInformation();
 
 	if (prettyPrint)
@@ -341,7 +341,7 @@ void JSONLayout::appendSerializedLocationInfo(LogString& buf,
 	LOG4CXX_DECODE_CHAR(fileName, locInfo.getFileName());
 	appendQuotedEscapedString(buf, fileName);
 	buf.append(LOG4CXX_STR(","));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -354,7 +354,7 @@ void JSONLayout::appendSerializedLocationInfo(LogString& buf,
 	StringHelper::toString(locInfo.getLineNumber(), p, lineNumber);
 	appendQuotedEscapedString(buf, lineNumber);
 	buf.append(LOG4CXX_STR(","));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -366,7 +366,7 @@ void JSONLayout::appendSerializedLocationInfo(LogString& buf,
 	LOG4CXX_DECODE_CHAR(className, locInfo.getClassName());
 	appendQuotedEscapedString(buf, className);
 	buf.append(LOG4CXX_STR(","));
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{
@@ -377,7 +377,7 @@ void JSONLayout::appendSerializedLocationInfo(LogString& buf,
 	buf.append(LOG4CXX_STR(": "));
 	LOG4CXX_DECODE_CHAR(methodName, locInfo.getMethodName());
 	appendQuotedEscapedString(buf, methodName);
-	buf.append(prettyPrint ? LOG4CXX_STR("\n") : LOG4CXX_STR(" "));
+	buf.append(prettyPrint ? LOG4CXX_EOL : LOG4CXX_STR(" "));
 
 	if (prettyPrint)
 	{