From: Anthony Geay Date: Thu, 4 Jan 2024 13:06:03 +0000 (+0100) Subject: [EDF29150] : Make the trace messages clearer and more efficient. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=24b0834d69dbae5959508a78c37f5c580baa7cc6;p=modules%2Fkernel.git [EDF29150] : Make the trace messages clearer and more efficient. --- diff --git a/src/Basics/KernelBasis.i b/src/Basics/KernelBasis.i index 3b733b01a..3d070b68c 100644 --- a/src/Basics/KernelBasis.i +++ b/src/Basics/KernelBasis.i @@ -70,6 +70,14 @@ bool VerbosityActivated(); void SetVerbosityActivated(bool flag); +bool IsDebugLevel(); + +bool IsInfoLevel(); + +bool IsWarningLevel(); + +bool IsErrorLevel(); + void WriteInStdout(const std::string& msg); void WriteInStderr(const std::string& msg); diff --git a/src/Basics/libSALOMELog.cxx b/src/Basics/libSALOMELog.cxx index 4491791e4..6c0cd55a8 100644 --- a/src/Basics/libSALOMELog.cxx +++ b/src/Basics/libSALOMELog.cxx @@ -37,7 +37,7 @@ namespace SALOME static constexpr char ERROR_LEVEL_VALUE = 0; static constexpr char ERROR_LEVEL_VALUE_STR[] = "ERROR"; static constexpr char WARNING_LEVEL_VALUE = 1; - static constexpr char WARNING_LEVEL_VALUE_STR[] = "wARNING"; + static constexpr char WARNING_LEVEL_VALUE_STR[] = "WARNING"; static constexpr char INFO_LEVEL_VALUE = 2; static constexpr char INFO_LEVEL_VALUE_STR[] = "INFO"; static constexpr char DEBUG_LEVEL_VALUE = 7; @@ -160,4 +160,24 @@ namespace SALOME { return FromVerbosityLevelToStr( VerbosityLevel() ); } + + bool IsDebugLevel() + { + return VerbosityLevel() >= VerbosityLevelType::debug_level; + } + + bool IsInfoLevel() + { + return VerbosityLevel() >= VerbosityLevelType::info_level; + } + + bool IsWarningLevel() + { + return VerbosityLevel() >= VerbosityLevelType::warning_level; + } + + bool IsErrorLevel() + { + return VerbosityLevel() >= VerbosityLevelType::error_level; + } } diff --git a/src/Basics/libSALOMELog.hxx b/src/Basics/libSALOMELog.hxx index df2716ea9..f4d91193e 100644 --- a/src/Basics/libSALOMELog.hxx +++ b/src/Basics/libSALOMELog.hxx @@ -37,6 +37,10 @@ namespace SALOME void BASICS_EXPORT SetVerbosityLevel(VerbosityLevelType level); void BASICS_EXPORT SetVerbosityLevelStr(const std::string& level); + bool BASICS_EXPORT IsDebugLevel(); + bool BASICS_EXPORT IsInfoLevel(); + bool BASICS_EXPORT IsWarningLevel(); + bool BASICS_EXPORT IsErrorLevel(); VerbosityLevelType BASICS_EXPORT VerbosityLevel(); std::string BASICS_EXPORT VerbosityLevelStr(); } diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 07fa5c866..87c92afe2 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -164,27 +164,11 @@ Abstract_Engines_Container_i::Abstract_Engines_Container_i (CORBA::ORB_ptr orb, std::string hostname = Kernel_Utils::GetHostname(); #ifndef WIN32 - MESSAGE(hostname << " " << getpid() << - " Engines_Container_i starting argc " << - _argc << " Thread " << pthread_self() ) ; + INFO_MESSAGE("Starting Container servant instance on Hostname :" << hostname << " with PID : " << getpid() ) ; #else MESSAGE(hostname << " " << _getpid() << " Engines_Container_i starting argc " << _argc<< " Thread " << pthread_self().p ) ; #endif - - int i = 0 ; - while ( _argv[ i ] ) - { - MESSAGE(" argv" << i << " " << _argv[ i ]) ; - i++ ; - } - - if ( argc < 2 ) - { - INFOS("SALOME_Container usage : SALOME_Container ServerName"); - ASSERT(0) ; - } - SCRUTE(argv[1]); _isSupervContainer = false; _orb = CORBA::ORB::_duplicate(orb) ; @@ -211,8 +195,8 @@ Abstract_Engines_Container_i::Abstract_Engines_Container_i (CORBA::ORB_ptr orb, CORBA::String_var sior = _orb->object_to_string(pCont); std::ostringstream myCommand; - myCommand << "pyCont = SALOME_Container.SALOME_Container_i('" << _containerName << "','" << sior << "','" << DFT_TIME_INTERVAL_BTW_MEASURE << "')\n"; - SCRUTE(myCommand.str()); + myCommand << "pyCont = SALOME_Container.SALOME_Container_i('" << _containerName << "','" << sior << "'," << DFT_TIME_INTERVAL_BTW_MEASURE << ")\n"; + INFO_MESSAGE("Python command executed : " << myCommand.str()); //[RNV]: Comment the PyEval_AcquireLock() and PyEval_ReleaseLock() because this //approach leads to the deadlock of the main thread of the application on Windows platform @@ -246,9 +230,8 @@ Abstract_Engines_Container_i::Abstract_Engines_Container_i (CORBA::ORB_ptr orb, //PyEval_ReleaseLock(); } {// register to NS after python initialization to be sure that client invoke after py constructor execution - SCRUTE(_containerName); _NS->Register(pCont, _containerName.c_str()); - MESSAGE("Engines_Container_i::Engines_Container_i : Container name " << _containerName); + DEBUG_MESSAGE("Container registred in NS as : " << _containerName); } fileTransfer_i* aFileTransfer = new fileTransfer_i(); CORBA::Object_var obref=aFileTransfer->_this(); diff --git a/src/Container/SALOME_Container.py b/src/Container/SALOME_Container.py index d3bbc084a..0745548d6 100644 --- a/src/Container/SALOME_Container.py +++ b/src/Container/SALOME_Container.py @@ -61,7 +61,8 @@ class SALOME_Container_i: #------------------------------------------------------------------------- def __init__(self ,containerName, containerIORStr, dftTimeIntervalInMs): - MESSAGE( "SALOME_Container_i::__init__" ) + # Warning this part of code is called at the very first step of container launching + # so logging is not instanciate. So use verbose method to discrimine if a message should be printed or not try: argv = sys.argv except AttributeError : @@ -76,8 +77,6 @@ class SALOME_Container_i: self._timeIntervalInMs = dftTimeIntervalInMs self._logm = None self._log = None - # let verbose here because SALOME_Container_i is instanciated before the container process verbosity mecanism is initialized - if verbose(): print("SALOME_Container.SALOME_Container_i : _containerName ",self._containerName) self._container = self._orb.string_to_object(containerIORStr) @property @@ -91,7 +90,6 @@ class SALOME_Container_i: #------------------------------------------------------------------------- def import_component(self, componentName): - MESSAGE( "SALOME_Container_i::import_component" ) ret="" try: logging.debug("try import ",componentName) @@ -122,7 +120,6 @@ class SALOME_Container_i: #------------------------------------------------------------------------- def create_component_instance(self, componentName, instanceName): - MESSAGE( "SALOME_Container_i::create_component_instance" ) comp_iors="" ret="" try: @@ -135,13 +132,11 @@ class SALOME_Container_i: instanceName, componentName) - MESSAGE( "SALOME_Container_i::create_component_instance : OK") comp_o = comp_i._this() comp_iors = self._orb.object_to_string(comp_o) except Exception: ret=traceback.format_exc(10) traceback.print_exc() - MESSAGE( "SALOME_Container_i::create_component_instance : NOT OK") return comp_iors, ret diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 0ec60bba3..e8d434d76 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -91,7 +91,6 @@ Utils_Mutex SALOME_ContainerManager::_systemMutex; SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableServer::POA_var poa, SALOME_NamingService_Abstract *ns) : _nbprocUsed(1),_delta_time_ns_lookup_in_ms(DFT_DELTA_TIME_NS_LOOKUP_IN_MS),_delta_time_measure_in_ms(Abstract_Engines_Container_i::DFT_TIME_INTERVAL_BTW_MEASURE) { - MESSAGE("constructor"); _NS = ns; _resManager = new SALOME_ResourcesManager_Client(ns); _time_out_in_second = GetTimeOutToLoaunchServer(); @@ -158,8 +157,6 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableSer } #endif #endif - - MESSAGE("constructor end"); } //============================================================================= diff --git a/src/Container/SALOME_FileTransfer_i.cxx b/src/Container/SALOME_FileTransfer_i.cxx index ddcc40b88..85cceccac 100644 --- a/src/Container/SALOME_FileTransfer_i.cxx +++ b/src/Container/SALOME_FileTransfer_i.cxx @@ -41,7 +41,6 @@ fileTransfer_i::fileTransfer_i() { - MESSAGE("fileTransfer_i::fileTransfer_i"); _fileKey=1; } @@ -53,7 +52,6 @@ fileTransfer_i::fileTransfer_i() fileTransfer_i::~fileTransfer_i() { - MESSAGE("fileTransfer_i::~fileTransfer_i"); } @@ -69,7 +67,6 @@ fileTransfer_i::~fileTransfer_i() CORBA::Long fileTransfer_i::open(const char* fileName) { - MESSAGE(" fileTransfer_i::open " << fileName); int aKey = _fileKey++; _ctr=0; FILE* fp; @@ -92,7 +89,6 @@ CORBA::Long fileTransfer_i::open(const char* fileName) void fileTransfer_i::close(CORBA::Long fileId) { - MESSAGE("fileTransfer_i::close"); FILE* fp; if (! (fp = _fileAccess[fileId]) ) { @@ -119,7 +115,6 @@ void fileTransfer_i::close(CORBA::Long fileId) Engines::fileBlock* fileTransfer_i::getBlock(CORBA::Long fileId) { - //MESSAGE("fileTransfer_i::getBlock"); Engines::fileBlock* aBlock = new Engines::fileBlock; FILE* fp; @@ -149,7 +144,6 @@ Engines::fileBlock* fileTransfer_i::getBlock(CORBA::Long fileId) */ CORBA::Long fileTransfer_i::openW(const char* fileName) { - MESSAGE(" fileTransfer_i::openW " << fileName); int aKey = _fileKey++; _ctr=0; FILE* fp; @@ -171,7 +165,6 @@ CORBA::Long fileTransfer_i::openW(const char* fileName) */ void fileTransfer_i::putBlock(CORBA::Long fileId, const Engines::fileBlock& block) { - MESSAGE("fileTransfer_i::putBlock"); FILE* fp; if (! (fp = _fileAccess[fileId]) ) { diff --git a/src/KERNEL_PY/salome_study.py b/src/KERNEL_PY/salome_study.py index 7cd966f23..43f88003a 100644 --- a/src/KERNEL_PY/salome_study.py +++ b/src/KERNEL_PY/salome_study.py @@ -271,11 +271,9 @@ def FindFileInDataDir(filename): #-------------------------------------------------------------------------- def openStudy(theStudyPath): - if verbose(): print("openStudy (begin)") global myStudy, myStudyName myStudy.Open(theStudyPath) myStudyName = myStudy._get_Name() - if verbose(): print("openStudy (end):", theStudyPath, myStudy._get_Name()) #-------------------------------------------------------------------------- @@ -290,16 +288,13 @@ def salome_study_init_without_session(theStudyPath=None): global myStudy, myStudyName global orb, lcc, naming_service, cm - if verbose(): print("theStudyPath:", theStudyPath) if not myStudy: import CORBA orb = CORBA.ORB_init(['']) # get Study reference - if verbose(): print("looking for study...") import KernelDS myStudy = KernelDS.myStudy() - if verbose(): print("Study found") pass import types @@ -327,15 +322,12 @@ def salome_study_init(theStudyPath=None): global myStudy, myStudyName global orb, lcc, naming_service, cm - if verbose(): print("theStudyPath:", theStudyPath) if not myStudy: orb, lcc, naming_service, cm, _, _, _ = salome_kernel.salome_kernel_init() # get Study reference - if verbose(): print("looking for study...") obj = naming_service.Resolve('/Study') myStudy = obj._narrow(SALOMEDS.Study) - if verbose(): print("Study found") pass import types diff --git a/src/Launcher/SALOME_LogManager.cxx b/src/Launcher/SALOME_LogManager.cxx index f55a618eb..ea61ade70 100644 --- a/src/Launcher/SALOME_LogManager.cxx +++ b/src/Launcher/SALOME_LogManager.cxx @@ -78,7 +78,7 @@ SALOME::vectorOfByte *SALOME_ContainerScriptExecPerfLog::getObj() void SALOME_ContainerScriptExecPerfLog::start() { AutoGIL gstate; - PyObject *result = PyObject_CallMethod(pyObj(),(char*)"start","",nullptr); + AutoPyRef result = PyObject_CallMethod(pyObj(),(char*)"start","",nullptr); if (PyErr_Occurred()) { std::string error("can not start"); @@ -128,14 +128,14 @@ Engines::ContainerScriptExecPerfLog_ptr SALOME_ContainerScriptPerfLog::addExecut _sessions.push_back( executionPtr2 ); { AutoGIL gstate; - PyObject *result = PyObject_CallMethod(pyObj(),(char*)"addExecution","",nullptr); + AutoPyRef result = PyObject_CallMethod(pyObj(),(char*)"addExecution","",nullptr); if (PyErr_Occurred()) { std::string error("can not addExecution"); PyErr_Print(); THROW_SALOME_CORBA_EXCEPTION(error.c_str(),SALOME::INTERNAL_ERROR); } - execution->setPyObj( result ); + execution->setPyObj( result.retn() );//ownership of result is transfered to execution } execution->start(); return executionPtr2._retn(); diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx index 80fd83365..ee8a3c284 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx @@ -46,8 +46,6 @@ SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& p _typeMap(typeMap),_typeList(typeList) { - BEGIN_OF("SALOME_ModuleCatalog_Handler"); - // XML Tags initialisation // Used in the function endElement test_path_prefix_name = "path-prefix-name"; @@ -102,8 +100,6 @@ SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& p test_component_list = "component-list"; test_component="component"; - - END_OF("SALOME_ModuleCatalog_Handler"); } //---------------------------------------------------------------------- @@ -112,8 +108,6 @@ SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& p //---------------------------------------------------------------------- SALOME_ModuleCatalog_Handler::~SALOME_ModuleCatalog_Handler() { - BEGIN_OF("~SALOME_ModuleCatalog_Handler()"); - END_OF("~SALOME_ModuleCatalog_Handler()"); } @@ -125,7 +119,6 @@ SALOME_ModuleCatalog_Handler::~SALOME_ModuleCatalog_Handler() void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) { - MESSAGE("Begin parse document"); // Empty the private elements _pathList.resize(0); _pathPrefix.listOfComputer.resize(0); @@ -225,15 +218,14 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) { if ( _typeMap.find(aType.name) == _typeMap.end() ) { - MESSAGE("Registered basic type: " << aType.name << " " << aType.kind ); _typeMap[aType.name]=aType; _typeList.push_back(aType); } else - MESSAGE( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." ); + INFO_MESSAGE( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." ); } else - MESSAGE( "Warning: this type (" << aType.name << "," << aType.kind << ") has incorrect kind, it will be ignored." ); + INFO_MESSAGE( "Warning: this type (" << aType.name << "," << aType.kind << ") has incorrect kind, it will be ignored." ); } else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"sequence" )) { @@ -255,16 +247,15 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) { if ( _typeMap.find(aType.name) == _typeMap.end() ) { - MESSAGE("Registered sequence type: " << aType.name << " " << aType.content ); _typeMap[aType.name]=aType; _typeList.push_back(aType); } else - MESSAGE( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." ); + INFO_MESSAGE( "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored." ); } else { - MESSAGE( "Warning: this sequence type (" << aType.name << "," << aType.content << ") has unknown content type, it will be ignored." ); + INFO_MESSAGE( "Warning: this sequence type (" << aType.name << "," << aType.content << ") has unknown content type, it will be ignored." ); } } else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"objref" )) @@ -375,7 +366,6 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) { if ( _typeMap.find(aType.name) == _typeMap.end() ) { - MESSAGE("Registered struct type: " << aType.name << " " << aType.id ); _typeMap[aType.name]=aType; _typeList.push_back(aType); } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index eeccfc096..fa6847222 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -208,7 +208,7 @@ public: SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA::ORB_ptr orb) : _orb(orb) { myPrivate = new Private; - MESSAGE("Catalog creation"); + DEBUG_MESSAGE("Catalog creation"); /* Init libxml */ xmlInitParser(); @@ -291,11 +291,11 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: // Verification of _general_path_list content if (!myPrivate->_verify_path_prefix(myPrivate->_general_path_list)) { - MESSAGE( "Error while parsing the general path list, " + WARNING_MESSAGE( "Error while parsing the general path list, " "different paths are associated to the same computer," "the first one will be chosen"); } else { - MESSAGE("General path list OK"); + DEBUG_MESSAGE("General path list OK"); } if (myPrivate->_personal_path != NULL) { @@ -316,7 +316,7 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: MESSAGE("Personal path list OK"); } }else - MESSAGE("No personal catalog indicated or error while " + INFO_MESSAGE("No personal catalog indicated or error while " "opening the personal catalog"); } } @@ -845,8 +845,7 @@ SALOME_ModuleCatalogImpl::Private::_parse_xml_file(const char* file, ParserTypes& typeMap, TypeList& typeList) { - BEGIN_OF("_parse_xml_file"); - SCRUTE(file); + DEBUG_MESSAGE("parsing of " << file); //Local path and module list for the file to parse ParserPathPrefixes _pathList; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 1173574d9..adf58b6a3 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -157,17 +157,12 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) aCurNode = aCurNode->next; } -#ifdef _DEBUG_ - for (std::map::const_iterator iter = _resources_list.begin(); - iter != _resources_list.end(); - iter++) + DEBUG_MESSAGE( "************************************************" ); + for (std::map::const_iterator iter = _resources_list.begin(); iter != _resources_list.end(); iter++) { - MESSAGE( "************************************************" ); - MESSAGE( "Resource " << (*iter).first << " found:" ); - MESSAGE( (*iter).second ); - MESSAGE( "************************************************" ); + DEBUG_MESSAGE( "Resource " << (*iter).first << " found: " << std::endl << (*iter).second); } -#endif + DEBUG_MESSAGE( "************************************************" ); } bool @@ -465,7 +460,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser } catch (const ResourcesException &) { - MESSAGE( "Warning, invalid type \"" << (const char*)type << "\" for resource \"" << + INFO_MESSAGE( "Warning, invalid type \"" << (const char*)type << "\" for resource \"" << resource.Name << "\", using default value \"" << resource.getResourceTypeStr() << "\"" ) ; } @@ -473,7 +468,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser } else { - MESSAGE( "Warning, no type found for resource \"" << resource.Name << + INFO_MESSAGE( "Warning, no type found for resource \"" << resource.Name << "\", using default value \"" << resource.getResourceTypeStr() << "\""); } diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 632a326b6..4fe4b5fd5 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -96,7 +96,6 @@ SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb, PortableServer::POA_var poa, SALOME_NamingService_Abstract *ns) : _rm(new ResourcesManager_cpp()) { - MESSAGE("SALOME_ResourcesManager constructor"); _NS = ns; _orb = CORBA::ORB::_duplicate(orb) ; // @@ -113,8 +112,6 @@ SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb, Engines::ResourcesManager_var refContMan = Engines::ResourcesManager::_narrow(obj); if(_NS) _NS->Register(refContMan,_ResourcesManagerNameInNS); - - MESSAGE("SALOME_ResourcesManager constructor end"); } //============================================================================= diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index b91b25ea3..51d4b7ea6 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -483,7 +483,6 @@ void SALOMEDS_Study_i::Clear() PortableServer::POA_ptr SALOMEDS_Study_i::_default_POA() { PortableServer::POA_ptr poa = GetThePOA(); - MESSAGE("SALOMEDS_Study_i::_default_POA: " << poa); return PortableServer::POA::_duplicate(poa); } diff --git a/src/SALOMELocalTrace/LocalTraceCollector.cxx b/src/SALOMELocalTrace/LocalTraceCollector.cxx index e44c7a806..e348c8349 100644 --- a/src/SALOMELocalTrace/LocalTraceCollector.cxx +++ b/src/SALOMELocalTrace/LocalTraceCollector.cxx @@ -119,12 +119,7 @@ void* LocalTraceCollector::run(void* /*bid*/) if( SALOME::VerbosityActivated() ) { std::cout << std::flush ; -#ifndef WIN32 - std::cerr << "th. " << myTrace.threadId << " " << myTrace.trace; -#else - std::cerr << "th. " << (void*)(&myTrace.threadId) - << " " << myTrace.trace; -#endif + std::cerr << myTrace.trace; std::cerr << std::flush ; } } diff --git a/src/SALOMELocalTrace/utilities.h b/src/SALOMELocalTrace/utilities.h index e08694acc..72414f9d5 100644 --- a/src/SALOMELocalTrace/utilities.h +++ b/src/SALOMELocalTrace/utilities.h @@ -110,8 +110,12 @@ << " at " << __TIME__ << MESS_END }} -#define MESSAGE(msg) { if (SALOME::VerbosityActivated()) {MESS_BEGIN("- Trace ") << msg << MESS_END}} -#define SCRUTE(var) { if (SALOME::VerbosityActivated()) {MESS_BEGIN("- Trace ") << #var << "=" << var <retrieve(myTrace); - //if (!CORBA::is_nil(_orb)) - if (true) - { - if (myTrace.traceType == ABORT_MESS) - { - std::stringstream abortMessage(""); -#ifndef WIN32 - abortMessage << "INTERRUPTION from thread " - << myTrace.threadId << " : " << myTrace.trace; -#else - abortMessage << "INTERRUPTION from thread " - << (void*)&myTrace.threadId - << " : " << myTrace.trace; -#endif - CORBA::String_var LogMsg = - CORBA::string_dup(abortMessage.str().c_str()); - m_pInterfaceLogger->putMessage(LogMsg); - exit(1); - } - else - { - std::stringstream aMessage(""); -#ifndef WIN32 - aMessage << "th. " << myTrace.threadId -#else - aMessage << "th. " << (void*)&myTrace.threadId -#endif - << " " << myTrace.trace; - CORBA::String_var LogMsg = - CORBA::string_dup(aMessage.str().c_str()); - m_pInterfaceLogger->putMessage(LogMsg); - } - } + { + if (myTrace.traceType == ABORT_MESS) + { + std::ostringstream abortMessage; + abortMessage << "INTERRUPTION from thread : " << myTrace.trace; + CORBA::String_var LogMsg = + CORBA::string_dup(abortMessage.str().c_str()); + m_pInterfaceLogger->putMessage(LogMsg); + exit(1); + } + else + { + std::ostringstream aMessage; + aMessage << " " << myTrace.trace; + CORBA::String_var LogMsg = + CORBA::string_dup(aMessage.str().c_str()); + m_pInterfaceLogger->putMessage(LogMsg); + } + } } pthread_exit(NULL); return NULL;