From: Anthony Geay Date: Fri, 6 Jan 2023 16:19:02 +0000 (+0100) Subject: LocalTraceCollector also sensible to SALOME_VERBOSE env var X-Git-Tag: V9_11_0a1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e7d8bf1508ad8f63a92bed41982bcd8c609788a2;p=modules%2Fkernel.git LocalTraceCollector also sensible to SALOME_VERBOSE env var --- diff --git a/src/SALOMELocalTrace/LocalTraceCollector.cxx b/src/SALOMELocalTrace/LocalTraceCollector.cxx index 85f3a7e67..ab3f4e034 100644 --- a/src/SALOMELocalTrace/LocalTraceCollector.cxx +++ b/src/SALOMELocalTrace/LocalTraceCollector.cxx @@ -25,13 +25,15 @@ // Module : KERNEL // $Header$ // + +#include "LocalTraceCollector.hxx" +#include "libSALOMELog.hxx" + #include #include #include #include -#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);