Back to index

salome-kernel  6.5.0
Classes | Functions
KERNEL_PY.kernel.logger Namespace Reference

Classes

class  Logger
class  _UnFlushableLogStream
class  ExtLogger

Functions

def TEST_Logger

Function Documentation

Test function for logger module

Definition at line 192 of file logger.py.

00192 
00193 def TEST_Logger():
00194     """Test function for logger module"""
00195     log = Logger("TST")
00196 
00197     # Base methods
00198     log.info("Information message")
00199     log.debug("Debug message")
00200     log.fatal("Fatal error message")
00201 
00202     # Message building
00203     data = 12
00204     log.info("This message displays data = " + str(data))
00205 
00206     data = {}
00207     data["KERNEL"] = "V1"
00208     data["GEOM"] = "V2"
00209     log.info("This message displays data = " + str(data))
00210 
00211     # Test with a non-string parameter
00212     log.info(data)
00213 
00214     # Test with a default instance
00215     log = Logger()
00216     log.info("Default logger")
00217 
00218     # Test showDebug method
00219     log.setLogFile("test.log")
00220     log.debug("Debug trace")
00221     log.hideDebug()
00222     log.debug("This trace should NOT be displayed")
00223     log.showDebug()
00224     log.debug("This trace should be displayed")
00225     log.closeLogFile()
00226     log.info("After closing the log file")
00227 
00228 
# Main function only used to test the module