You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rm...@apache.org on 2021/08/21 02:33:51 UTC

[logging-log4cxx] branch LOGCXX-431 updated (0b08d4e -> 3687a8b)

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

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


    from 0b08d4e  Create strings as LOGSTRING to compile on windows
     new 60184d7  More logstrings
     new 3687a8b  Fix pthread name test for linux

The 2 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:
 src/cmake/pthread/log4cxx-pthread.cmake | 3 ++-
 src/cmake/pthread/test-pthread.cpp      | 2 +-
 src/main/cpp/threadutility.cpp          | 8 ++++----
 3 files changed, 7 insertions(+), 6 deletions(-)

[logging-log4cxx] 02/02: Fix pthread name test for linux

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

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

commit 3687a8b253a196786b45b506b03399fc530fecd9
Author: Robert Middleton <ro...@rm5248.com>
AuthorDate: Fri Aug 20 22:33:44 2021 -0400

    Fix pthread name test for linux
---
 src/cmake/pthread/log4cxx-pthread.cmake | 3 ++-
 src/cmake/pthread/test-pthread.cpp      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cmake/pthread/log4cxx-pthread.cmake b/src/cmake/pthread/log4cxx-pthread.cmake
index aa3647b..d4a5272 100644
--- a/src/cmake/pthread/log4cxx-pthread.cmake
+++ b/src/cmake/pthread/log4cxx-pthread.cmake
@@ -1,5 +1,6 @@
 include(FindThreads)
 
 try_compile(PTHREAD_SETNAME_NP_FOUND "${CMAKE_BINARY_DIR}/pthread-compile-tests"
-    "${CMAKE_CURRENT_LIST_DIR}/test-pthread.cpp")
+    "${CMAKE_CURRENT_LIST_DIR}/test-pthread.cpp"
+    LINK_LIBRARIES Threads::Threads )
 
diff --git a/src/cmake/pthread/test-pthread.cpp b/src/cmake/pthread/test-pthread.cpp
index f30cd1a..73f453c 100644
--- a/src/cmake/pthread/test-pthread.cpp
+++ b/src/cmake/pthread/test-pthread.cpp
@@ -2,5 +2,5 @@
 
 int main(){
 	pthread_t tid;
-	pthread_set_name_np(tid, "name");
+	pthread_setname_np(tid, "name");
 }

[logging-log4cxx] 01/02: More logstrings

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

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

commit 60184d702279dd279cbd30e2e1596634cc47c979
Author: Robert Middleton <ro...@rm5248.com>
AuthorDate: Fri Aug 20 22:26:38 2021 -0400

    More logstrings
---
 src/main/cpp/threadutility.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp
index bdd301b..c7990d9 100644
--- a/src/main/cpp/threadutility.cpp
+++ b/src/main/cpp/threadutility.cpp
@@ -46,7 +46,7 @@ void ThreadUtility::preThreadBlockSignals(){
 	sigset_t set;
 	sigfillset(&set);
 	if( pthread_sigmask(SIG_SETMASK, &set, nullptr) < 0 ){
-		LOGLOG_ERROR( "Unable to set thread sigmask" );
+		LOGLOG_ERROR( LOG4CXX_STR("Unable to set thread sigmask") );
 	}
 #endif /* LOG4CXX_HAS_PTHREAD_SIGMASK */
 }
@@ -60,12 +60,12 @@ void ThreadUtility::threadStartedNameThread(LogString threadName,
 							 std::thread::native_handle_type native_handle){
 #if LOG4CXX_HAS_PTHREAD_SETNAME
 	if( pthread_setname_np( static_cast<pthread_t>( native_handle ), threadName.c_str() ) < 0 ){
-		LOGLOG_ERROR( "unable to set thread name" );
+		LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") );
 	}
 #elif LOG4CXX_HAS_SETTHREADDESCRIPTION
 	HRESULT hr = SetThreadDescription(static_cast<HANDLE>(native_handle), threadName.c_str());
 	if(FAILED(hr)){
-		LOGLOG_ERROR( "unable to set thread name" );
+		LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") );
 	}
 #endif
 }
@@ -77,7 +77,7 @@ void ThreadUtility::postThreadUnblockSignals(){
 	sigset_t set;
 	sigemptyset(&set);
 	if( pthread_sigmask(SIG_SETMASK, &set, nullptr) < 0 ){
-		LOGLOG_ERROR( "Unable to set thread sigmask" );
+		LOGLOG_ERROR( LOG4CXX_STR("Unable to set thread sigmask") );
 	}
 #endif /* LOG4CXX_HAS_PTHREAD_SIGMASK */
 }