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


##########
src/main/cpp/threadutility.cpp:
##########
@@ -267,21 +269,30 @@ ThreadStartPost ThreadUtility::postStartFunction()
  */
 void ThreadUtility::addPeriodicTask(const LogString& name, 
std::function<void()> f, const Period& delay)
 {
+       if (!m_priv->log)
+               m_priv->log = Logger::getLogger("ThreadUtility");

Review Comment:
   I do not intend to use them for the normal logging route (through configured 
appenders). The lack of a prefix works with LogLog, which adds the log4cxx: 
prefix to each line.
   
   ```
     testPeriodicTaskRestartsAfterEmptyQueue
   log4cxx: Checking file log4cxx.xml
   log4cxx: Checking file log4cxx.properties
   log4cxx: Checking file log4j.xml
   log4cxx: Checking file log4j.properties
   log4cxx: Could not find default configuration file.
   log4cxx: 24296 ThreadUtility::addPeriodicTask: ThreadUtilityTest.first
   log4cxx: 29676 ThreadUtility::doPeriodicTasks: started
   log4cxx: 32156 ThreadUtility::removePeriodicTask: ThreadUtilityTest.first
   log4cxx: 35626 ThreadUtility::doPeriodicTasks: erase ThreadUtilityTest.first
   log4cxx: 38138 ThreadUtility::doPeriodicTasks: stopped
   log4cxx: 94251 ThreadUtility::addPeriodicTask: ThreadUtilityTest.second
   log4cxx: 97812 ThreadUtility::doPeriodicTasks: started
   log4cxx: 110211 ThreadUtility::removePeriodicTask: ThreadUtilityTest.second
   log4cxx: 115104 ThreadUtility::doPeriodicTasks: erase 
ThreadUtilityTest.second
   log4cxx: 117910 ThreadUtility::doPeriodicTasks: stopped
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to