diff OrthancServer/Sources/ServerIndex.cpp @ 5450:9ffd6d18daf3 pg-transactions

log lines now contain the thread name
author Alain Mazy <am@osimis.io>
date Tue, 05 Dec 2023 16:26:35 +0100
parents b83192e7ad10
children 176bc05f85f4 68e9f7815fb8
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerIndex.cpp	Wed Nov 29 09:28:21 2023 +0100
+++ b/OrthancServer/Sources/ServerIndex.cpp	Tue Dec 05 16:26:35 2023 +0100
@@ -276,6 +276,8 @@
   void ServerIndex::FlushThread(ServerIndex* that,
                                 unsigned int threadSleepGranularityMilliseconds)
   {
+    Logging::SetCurrentThreadName("DB-FLUSH");
+
     // By default, wait for 10 seconds before flushing
     static const unsigned int SLEEP_SECONDS = 10;
 
@@ -429,6 +431,8 @@
   void ServerIndex::UnstableResourcesMonitorThread(ServerIndex* that,
                                                    unsigned int threadSleepGranularityMilliseconds)
   {
+    Logging::SetCurrentThreadName("UNSTABLE-MON");
+
     int stableAge;
     
     {