You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/09/30 19:40:17 UTC

[GitHub] [logging-log4cxx] swebb2066 commented on a diff in pull request #135: Reduce disabled logger overhead

swebb2066 commented on code in PR #135:
URL: https://github.com/apache/logging-log4cxx/pull/135#discussion_r984899172


##########
src/main/cpp/hierarchy.cpp:
##########
@@ -433,6 +433,22 @@ void Hierarchy::updateChildren(ProvisionNode& pn, const LoggerPtr& logger)
 			l->setParent( logger );
 		}
 	}
+    
+}
+
+void Hierarchy::updateChildren(const Logger* parent)
+{
+	for (auto& item : m_priv->loggers)
+	{
+		for (auto l = item.second; l; l = l->getParent())
+		{
+			if (l->getParent().get() == parent)

Review Comment:
   `for (auto l = item.second; l; l = l->getParent())` goes through each parent until root. A `getRootLoggger().setLevel()` will find that `com.example.foo` and `com.example` has 'com' in the parent hierarchy.
   
   `for (auto& item : m_priv->loggers)` checks every configured logger in the application.
   
   I will add a test to confirm.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org