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 2020/08/07 15:18:10 UTC

[logging-log4cxx] branch logcxx_455_quiet_mode updated (6384112 -> 7f28435)

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

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


 discard 6384112  Changed the implementation to handle "quietMode" always. That has been the requested behaviour in LOGCXX-455 and it seems to simply make sense to handle that always at one place.
     new 7f28435  Changed the implementation to handle "quietMode" always. That has been the requested behaviour in LOGCXX-455 and it seems to simply make sense to handle that always at one place.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6384112)
            \
             N -- N -- N   refs/heads/logcxx_455_quiet_mode (7f28435)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:


[logging-log4cxx] 01/01: Changed the implementation to handle "quietMode" always. That has been the requested behaviour in LOGCXX-455 and it seems to simply make sense to handle that always at one place.

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

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

commit 7f2843558b803af947a0617bedf1e5d5c2e7116e
Author: Thorsten Schöning <ts...@am-soft.de>
AuthorDate: Fri Aug 7 17:12:23 2020 +0200

    Changed the implementation to handle "quietMode" always. That has been the requested behaviour in LOGCXX-455 and it seems to simply make sense to handle that always at one place.
    
    https://issues.apache.org/jira/projects/LOGCXX/issues/LOGCXX-455
---
 src/changes/changes.xml |  1 +
 src/main/cpp/loglog.cpp | 39 +++++++++++++++++++++++++--------------
 2 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 314c671..937fc4a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -39,6 +39,7 @@
 			<action issue="LOGCXX-483" type="update">Not able to see hebrew values when logging in log4cxx</action>
 			<action issue="LOGCXX-482" type="fix">Build failure with GCC-6</action>
 			<action issue="LOGCXX-464" type="fix">TimeBasedRollingPolicy should append as configured on rollover</action>
+			<action issue="LOGCXX-455" type="fix">LogLog::setQuietMode(true) does not suppress exception reporting</action>
 			<action issue="LOGCXX-446" type="fix">make install fails, trying to overwrite header files</action>
 			<action issue="LOGCXX-443" type="fix">Return by const reference in Logger::getName()</action>
 			<action issue="LOGCXX-433" type="fix">Autoconf 2.69 needs 'ACLOCAL_AMFLAGS= -I .'</action>
diff --git a/src/main/cpp/loglog.cpp b/src/main/cpp/loglog.cpp
index faf21ef..7b1e867 100644
--- a/src/main/cpp/loglog.cpp
+++ b/src/main/cpp/loglog.cpp
@@ -34,8 +34,8 @@ LogLog::LogLog() : mutex(APRInitializer::getRootPool())
 {
 	synchronized sync(mutex);
 
-	debugEnabled    = false;
-	quietMode       = false;
+	debugEnabled	= false;
+	quietMode		= false;
 }
 
 LogLog& LogLog::getInstance()
@@ -54,16 +54,23 @@ void LogLog::setInternalDebugging(bool debugEnabled1)
 
 void LogLog::debug(const LogString& msg)
 {
-	synchronized sync(getInstance().mutex);
-
-	if (getInstance().debugEnabled && !getInstance().quietMode)
+	if (!getInstance().debugEnabled)
 	{
-		emit(msg);
+		return;
 	}
+
+	synchronized sync(getInstance().mutex);
+
+	emit(msg);
 }
 
 void LogLog::debug(const LogString& msg, const std::exception& e)
 {
+	if (!getInstance().debugEnabled)
+	{
+		return;
+	}
+
 	synchronized sync(getInstance().mutex);
 
 	debug(msg);
@@ -75,10 +82,7 @@ void LogLog::error(const LogString& msg)
 {
 	synchronized sync(getInstance().mutex);
 
-	if (!getInstance().quietMode)
-	{
-		emit(msg);
-	}
+	emit(msg);
 }
 
 void LogLog::error(const LogString& msg, const std::exception& e)
@@ -100,10 +104,7 @@ void LogLog::warn(const LogString& msg)
 {
 	synchronized sync(getInstance().mutex);
 
-	if (!getInstance().quietMode)
-	{
-		emit(msg);
-	}
+	emit(msg);
 }
 
 void LogLog::warn(const LogString& msg, const std::exception& e)
@@ -116,6 +117,11 @@ void LogLog::warn(const LogString& msg, const std::exception& e)
 
 void LogLog::emit(const LogString& msg)
 {
+	if (getInstance().quietMode)
+	{
+		return;
+	}
+
 	LogString out(LOG4CXX_STR("log4cxx: "));
 
 	out.append(msg);
@@ -126,6 +132,11 @@ void LogLog::emit(const LogString& msg)
 
 void LogLog::emit(const std::exception& ex)
 {
+	if (getInstance().quietMode)
+	{
+		return;
+	}
+
 	LogString out(LOG4CXX_STR("log4cxx: "));
 	const char* raw = ex.what();