Back to index

salome-kernel  6.5.0
Public Member Functions
KERNEL_PY.kernel.logger.ExtLogger Class Reference
Inheritance diagram for KERNEL_PY.kernel.logger.ExtLogger:
Inheritance graph
[legend]
Collaboration diagram for KERNEL_PY.kernel.logger.ExtLogger:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def debug
def showDebug
def setLogFile
def setColor
def closeLogFile
def hideDebug
def fatal

Detailed Description

This class extends :class:`Logger` class and adds exception information
when DEBUG messages are recorded. It exists mainly for backward
compatibility, as the same thing can be done by calling
``Logger.debug(message, exc_info = True)``.

Definition at line 169 of file logger.py.


Constructor & Destructor Documentation

def KERNEL_PY.kernel.logger.ExtLogger.__init__ (   self,
  keyword = "KEY",
  level = salome.kernel.logconfig.loggingLevel,
  color = None,
  sourceFileName = None 
)

Reimplemented from KERNEL_PY.kernel.logger.Logger.

Definition at line 181 of file logger.py.

00181 
00182                  color = None, sourceFileName=None):
00183         Logger.__init__(self, keyword, level, color, sourceFileName)


Member Function Documentation

def KERNEL_PY.kernel.logger.Logger.closeLogFile (   self) [inherited]
Close the log file.

Definition at line 130 of file logger.py.

00130 
00131     def closeLogFile(self):
00132         """Close the log file."""
00133         if self._fileHandler is not None:
00134             self.removeHandler(self._fileHandler)
00135             self._fileHandler.close()
00136             self._fileHandler = None

Here is the caller graph for this function:

def KERNEL_PY.kernel.logger.ExtLogger.debug (   self,
  message 
)
Log a DEBUG message with exception information (equivalent to
``Logger.debug(message, exc_info = True)``).

Definition at line 184 of file logger.py.

00184 
00185     def debug( self, message ):
00186         """
00187         Log a DEBUG message with exception information (equivalent to
00188         ``Logger.debug(message, exc_info = True)``).
00189         """
00190         Logger.debug(self, message, exc_info = True)
00191 

def KERNEL_PY.kernel.logger.Logger.fatal (   self,
  message 
) [inherited]
Log a message with CRITICAL level. This method only exists for
backward compatibility and is equivalent to ``critical(message)``.

Definition at line 145 of file logger.py.

00145 
00146     def fatal(self, message):
00147         """
00148         Log a message with CRITICAL level. This method only exists for
00149         backward compatibility and is equivalent to ``critical(message)``.
00150         """
00151         self.critical(message)
00152 

def KERNEL_PY.kernel.logger.Logger.hideDebug (   self) [inherited]
Hide DEBUG level messages (equivalent to ``setLevel(logging.INFO)``).

Definition at line 137 of file logger.py.

00137 
00138     def hideDebug(self):
00139         """
00140         Hide DEBUG level messages (equivalent to ``setLevel(logging.INFO)``).
00141         """
00142         self.setLevel(logging.INFO)

Here is the call graph for this function:

def KERNEL_PY.kernel.logger.Logger.setColor (   self,
  color 
) [inherited]
Set the color of log messages on color-capable terminals. If `color`
is :const:`None`, the default color will be used.

Definition at line 115 of file logger.py.

00115 
00116     def setColor(self, color):
00117         """
00118         Set the color of log messages on color-capable terminals. If `color`
00119         is :const:`None`, the default color will be used.
00120         """
00121         if color is None or not termcolor.canDisplayColor(self._stdoutStream):
00122             stdoutFormatter = self._baseFormatter
00123         else:
00124             format = ("%s%s%s" %
00125                       (termcolor.getControlSequence(color),
00126                        self._baseFormatString,
00127                        termcolor.getControlSequence(termcolor.DEFAULT)))
00128             stdoutFormatter = logging.Formatter(format)
00129         self._stdoutHandler.setFormatter(stdoutFormatter)

def KERNEL_PY.kernel.logger.Logger.setLogFile (   self,
  logFilename 
) [inherited]
Define a log file to record the log messages (in addition to the
standard output).

Definition at line 104 of file logger.py.

00104 
00105     def setLogFile(self, logFilename):
00106         """
00107         Define a log file to record the log messages (in addition to the
00108         standard output).
00109         """
00110         self.closeLogFile()
00111         self._fileHandler = logging.FileHandler(logFilename, 'w')
00112         self._fileHandler.setLevel(logging.DEBUG)
00113         self._fileHandler.setFormatter(self._baseFormatter)
00114         self.addHandler(self._fileHandler)

Here is the call graph for this function:

def KERNEL_PY.kernel.logger.Logger.showDebug (   self) [inherited]
Log all messages, including DEBUG level messages (equivalent to
``setLevel(logging.DEBUG)``).

Definition at line 97 of file logger.py.

00097 
00098     def showDebug(self):
00099         """
00100         Log all messages, including DEBUG level messages (equivalent to
00101         ``setLevel(logging.DEBUG)``).
00102         """
00103         self.setLevel(logging.DEBUG)


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