]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
LocalTraceCollector also sensible to SALOME_VERBOSE env var
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 6 Jan 2023 16:19:02 +0000 (17:19 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 6 Jan 2023 16:19:02 +0000 (17:19 +0100)
src/SALOMELocalTrace/LocalTraceCollector.cxx

index 85f3a7e67dfae6574463e640b97a8fc7bfd7245a..ab3f4e034e6868701b7498fe20bba5640e2f5e9a 100644 (file)
 //  Module : KERNEL
 //  $Header$
 //
+
+#include "LocalTraceCollector.hxx"
+#include "libSALOMELog.hxx"
+
 #include <iostream>
 #include <sstream>
 #include <fstream>
 #include <cstdlib>
 
-#include "LocalTraceCollector.hxx"
-
 // ============================================================================
 /*!
  *  This class is for use without CORBA, inside or outside SALOME.
@@ -98,37 +100,42 @@ void* LocalTraceCollector::run(void* /*bid*/)
       myTraceBuffer->retrieve(myTrace);
       if (myTrace.traceType == ABORT_MESS)
         {
-          std::cout << std::flush ;
+          if( SALOME::VerbosityActivated() )
+          {
+            std::cout << std::flush ;
 #ifndef WIN32
-          std::cerr << "INTERRUPTION from thread " << myTrace.threadId
-               << " : " <<  myTrace.trace;
+            std::cerr << "INTERRUPTION from thread " << myTrace.threadId
+                << " : " <<  myTrace.trace;
 #else
-          std::cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
-               << " : " <<  myTrace.trace;
+            std::cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId)
+                << " : " <<  myTrace.trace;
 #endif
-          std::cerr << std::flush ; 
+            std::cerr << std::flush ; 
+          }
           exit(1);     
         }
       else if (myTrace.traceType == NORMAL_MESS)
         {
-          std::cout << std::flush ;
+          if( SALOME::VerbosityActivated() )
+          {
+            std::cout << std::flush ;
 #ifndef WIN32
-          std::cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
+            std::cerr << "th. " << myTrace.threadId << " " << myTrace.trace;
 #else
-          std::cerr << "th. " << (void*)(&myTrace.threadId)
-               << " " << myTrace.trace;
+            std::cerr << "th. " << (void*)(&myTrace.threadId)
+                << " " << myTrace.trace;
 #endif
-          std::cerr << std::flush ; 
+            std::cerr << std::flush ;
+          } 
         }
       else 
         {
-          std::cout << std::flush ;
-#ifndef WIN32
-          std::cerr << myTrace.trace;
-#else
-          std::cerr << myTrace.trace;
-#endif
-          std::cerr << std::flush ; 
+          if( SALOME::VerbosityActivated() )
+          {
+            std::cout << std::flush ;
+            std::cerr << myTrace.trace;
+            std::cerr << std::flush ;
+          }
         }
     }
   pthread_exit(NULL);