]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF29150] : Make the trace messages clearer and more efficient.
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 4 Jan 2024 13:06:03 +0000 (14:06 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 4 Jan 2024 13:06:03 +0000 (14:06 +0100)
17 files changed:
src/Basics/KernelBasis.i
src/Basics/libSALOMELog.cxx
src/Basics/libSALOMELog.hxx
src/Container/Container_i.cxx
src/Container/SALOME_Container.py
src/Container/SALOME_ContainerManager.cxx
src/Container/SALOME_FileTransfer_i.cxx
src/KERNEL_PY/salome_study.py
src/Launcher/SALOME_LogManager.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx
src/ResourcesManager/SALOME_ResourcesManager.cxx
src/SALOMEDS/SALOMEDS_Study_i.cxx
src/SALOMELocalTrace/LocalTraceCollector.cxx
src/SALOMELocalTrace/utilities.h
src/SALOMETraceCollector/SALOMETraceCollector.cxx

index 3b733b01a99a7f69885667706bc1022777856940..3d070b68c757d653990561a1705a45fbdf44e30f 100644 (file)
@@ -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);
index 4491791e4757f9d6cf0d8591dafa5db9211d8337..6c0cd55a85f63e512a8b59338901314a594b2d5c 100644 (file)
@@ -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;
+  }
 }
index df2716ea973c2b3e0ef4639756f9556491bb79c8..f4d91193e6555135b81cb6f8be3c487006e07206 100644 (file)
@@ -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();
 }
index 07fa5c8661d6d0419318987ac2ae7e499bac2ff6..87c92afe2d23846ed632ccefb3285b41158ad477 100644 (file)
@@ -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();
index d3bbc084aeef8f5039e57ebd36649f5f06101acc..0745548d675ba0364a3e18dc5f5c2077bab037bc 100644 (file)
@@ -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
 
 
index 0ec60bba3bd6110b37346b7b4948074bcc10dff2..e8d434d769af7de40480e7f68d66384a4bd38f84 100644 (file)
@@ -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");
 }
 
 //=============================================================================
index ddcc40b885e3f46eada08bd1aa1f2eb3710b5b89..85cceccac4cf61a5c742387334ea35813487170b 100644 (file)
@@ -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]) )
     {
index 7cd966f23dbcae4cb85b9fc7d172c5ac97eddb46..43f88003abcfbcff23a8b5446375dca45affb6e7 100644 (file)
@@ -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
index f55a618eb5a2190a1e6f634e67fdf428518ffffb..ea61ade7053b7fd665782fc29c0a0e7b2dcfcd54 100644 (file)
@@ -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();
index 80fd83365bc6c19a2b049c611e5baaa6c8cbc238..ee8a3c284499d9864cbfb067cbcb393de489f5cb 100644 (file)
@@ -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);
                       }
index eeccfc0960383bfdb47204566f08b4b934802a69..fa68472229cf49eaf8b0f5183a3b5f216069aa3e 100644 (file)
@@ -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;
index 1173574d9635b846a4b4eefa304970cbd9ebf0f5..adf58b6a347f5fd2379b55f3c2bd1e62afd14415 100644 (file)
@@ -157,17 +157,12 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
     aCurNode = aCurNode->next;
   }
 
-#ifdef _DEBUG_
-  for (std::map<std::string, ParserResourcesType>::const_iterator iter = _resources_list.begin();
-       iter != _resources_list.end();
-       iter++)
+  DEBUG_MESSAGE( "************************************************" );
+  for (std::map<std::string, ParserResourcesType>::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() << "\"");
   }
 
index 632a326b651fbe580c212c436365748ea5f9b44f..4fe4b5fd5e7b489c49d22cb94836d61b6262e202 100644 (file)
@@ -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");
 }
 
 //=============================================================================
index b91b25ea34749d473d7d1a4a818dbbcd2eb9c9d0..51d4b7ea608c92445a00b04ac8d60a20d8b450b5 100644 (file)
@@ -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);
 }
 
index e44c7a806cf0f3436aef14768ed0fd44d1b63658..e348c83495b7f5f74b18570911b3086435e3c036 100644 (file)
@@ -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 ;
           } 
         }
index e08694acca1a74321278454834ae9d78cad876b4..72414f9d5ba2f579820a3be4c9fbcddfea4f432b 100644 (file)
                                        << " 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 <<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 <<MESS_END}}
+#define ERROR_MESSAGE(msg) { if (SALOME::VerbosityActivated() && SALOME::IsErrorLevel()) {MESS_BEGIN("ERROR -") << msg << MESS_END}}
+#define WARNING_MESSAGE(msg) { if (SALOME::VerbosityActivated() && SALOME::IsWarningLevel()) {MESS_BEGIN("WARNING -") << msg << MESS_END}}
+#define INFO_MESSAGE(msg) { if (SALOME::VerbosityActivated() && SALOME::IsInfoLevel()) {MESS_BEGIN("INFO -") << msg << MESS_END}}
+#define DEBUG_MESSAGE(msg) { if (SALOME::VerbosityActivated() && SALOME::IsDebugLevel()) {MESS_BEGIN("DBG -") << msg << MESS_END}}
 
 #define REPERE ("------- ")
 #define BEGIN_OF(msg) { if (SALOME::VerbosityActivated()) {MESS_BEGIN(REPERE) << "Begin of: " << msg << MESS_END}}
index f860435de3d648c058cf1b800612728b6ab82368..d44e04b0ebbe9f37bfc01f66865a17f4aab3d81c 100644 (file)
@@ -123,39 +123,25 @@ void* SALOMETraceCollector::run(void* /*bid*/)
         }
 
       myTraceBuffer->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;