Back to index

salome-kernel  6.5.0
Public Member Functions | Public Attributes
SALOME_Trace.SALOME_Trace Class Reference

List of all members.

Public Member Functions

def __init__
def putMessage

Public Attributes

 m_pInterfaceLogger

Detailed Description

Definition at line 40 of file SALOME_Trace.py.


Constructor & Destructor Documentation

Definition at line 41 of file SALOME_Trace.py.

00041 
00042     def __init__(self):
00043         self.m_pInterfaceLogger = None
00044         if trace=="logger":
00045             ok = 0
00046             steps = 40
00047             while steps > 0 and ok == 0:
00048 
00049               try:
00050                 orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
00051                 theObj = orb.resolve_initial_references("NameService")
00052                 inc = theObj._narrow(CosNaming.NamingContext)
00053                 name = [CosNaming.NameComponent("Logger","")]
00054                 obj = inc.resolve(name);
00055 
00056                 self.m_pInterfaceLogger = obj._narrow(SALOME_Logger.Logger)
00057 
00058                 if not self.m_pInterfaceLogger is None:
00059                   ok = 1
00060 
00061               except CosNaming.NamingContext.NotFound, e :
00062                     if steps == 1: print "Caught exception: Naming Service can't found Logger"
00063               except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE):
00064                     if steps == 1: print "Caught CORBA::SystemException CommFailure"
00065               except CORBA.SystemException, e:
00066                     if steps == 1: print "Caught CORBA::SystemException."
00067               except CORBA.Exception, e:
00068                     if steps == 1: print "Caught CORBA::Exception."
00069               except Exception, e:
00070                     if steps == 1: print "Caught unknown exception."
00071 
00072               time.sleep(0.25)
00073               steps = steps - 1


Member Function Documentation

def SALOME_Trace.SALOME_Trace.putMessage (   self,
  LogMsg 
)

Definition at line 74 of file SALOME_Trace.py.

00074 
00075     def putMessage ( self, LogMsg ) :
00076         if (CORBA.is_nil(self.m_pInterfaceLogger)):
00077             print  LogMsg;
00078         else:
00079             self.m_pInterfaceLogger.putMessage (LogMsg)

Member Data Documentation

Definition at line 42 of file SALOME_Trace.py.


The documentation for this class was generated from the following file: