TestCenter Reference
TestSupport.Logging Namespace Reference

Package to provide logging functions. More...

Functions

def setStopped (stopped)
 
def info (message, stack=False, type='', depth=0)
 Put an info message to the log. More...
 
def infoHTML (message, type='', depth=0)
 Put an info message to the log while interpreting HTML. More...
 
def warning (message, stack=False, type='', depth=0)
 Put a warning to the log. More...
 
def warningHTML (message, type='', depth=0)
 Put a warning to the log while interpreting HTML. More...
 
def error (message, stack=False, type='', depth=0)
 Put an error to the log. More...
 
def errorHTML (message, type='', depth=0)
 Put an error to the log while interpreting HTML. More...
 
def showImage (description, *files)
 Put the ImageShow command to the log. More...
 
def showFile (description, *files)
 Put the FileShow command to the log. More...
 
def showDiff (description, fromLines, toLines, showOnlyContextOfDiff=False, numberOfContextLines=10)
 Creates a HTML diff from the two files and puts the FileShow command to the log. More...
 
def getStack (depth=0)
 Get the current stack. More...
 

Variables

bool gStopOnFirstError = False
 
bool gStopped = False
 

Detailed Description

Package to provide logging functions.

Function Documentation

◆ error()

def TestSupport.Logging.error (   message,
  stack = False,
  type = '',
  depth = 0 
)

◆ errorHTML()

def TestSupport.Logging.errorHTML (   message,
  type = '',
  depth = 0 
)

Put an error to the log while interpreting HTML.

Parameters
messageThe message to print. Any HTML tags inside are parsed as such.
typeThe type of message. Used internally to identify messages.

Definition at line 132 of file Logging.py.

References TestSupport.TestHelper.emitSpecialCommand(), TestSupport.Logging.error(), TestSupport.Logging.getStack(), TestSupport.Logging.showDiff(), TestSupport.Logging.showFile(), and TestSupport.Logging.showImage().

◆ getStack()

def TestSupport.Logging.getStack (   depth = 0)

Get the current stack.

There is the possibility to remove a given number of stack lines at the end of the list. This can be useful to remove unneccesary lines.

Parameters
depthNumber of stack lines to exclude.
Returns
String with the current stack description that can be handled by the report generators.

Definition at line 215 of file Logging.py.

Referenced by TestSupport.Logging.errorHTML().

◆ info()

def TestSupport.Logging.info (   message,
  stack = False,
  type = '',
  depth = 0 
)

Put an info message to the log.

Parameters
messageThe message to print.
stackDetermines whether a stack trace is included.
typeThe type of message. Used internally to identify messages.

Definition at line 78 of file Logging.py.

Referenced by TestCenterAdvanced.Master.Master.run(), and TestCenterAdvanced.Master.Master.stopSlave().

◆ infoHTML()

def TestSupport.Logging.infoHTML (   message,
  type = '',
  depth = 0 
)

Put an info message to the log while interpreting HTML.

Parameters
messageThe message to print. Any HTML tags inside are parsed as such.
typeThe type of message. Used internally to identify messages.

Definition at line 89 of file Logging.py.

◆ setStopped()

def TestSupport.Logging.setStopped (   stopped)

◆ showDiff()

def TestSupport.Logging.showDiff (   description,
  fromLines,
  toLines,
  showOnlyContextOfDiff = False,
  numberOfContextLines = 10 
)

Creates a HTML diff from the two files and puts the FileShow command to the log.

This command can be used to display the diff of two files. It will appear as link in the log file such that they can be downloaded.

Parameters
descriptionA string that describes the diff.
fromLinesThe array containing the lines of the left string or a filename of an existing file.
toLinesThe array containing the lines of the right string or a filename of an existing file.
showOnlyContextOfDiffIf true, then only the context lines around the diff are shown, otherwise the whole content is shown.
numberOfContextLinesThe number of context line only the diff context is shown.

Definition at line 187 of file Logging.py.

Referenced by TestSupport.Logging.errorHTML().

◆ showFile()

def TestSupport.Logging.showFile (   description,
files 
)

Put the FileShow command to the log.

This command can be used to display a set of files. They will appear as links in the log file such that they can be downloaded.

Parameters
descriptionA message show with the images.
filesArbitrary number of arguments treated as file names.

Definition at line 163 of file Logging.py.

Referenced by TestSupport.Logging.errorHTML().

◆ showImage()

def TestSupport.Logging.showImage (   description,
files 
)

Put the ImageShow command to the log.

This command can be used to display a set of images in the report.

Parameters
descriptionA message show with the images.
filesArbitrary number of arguments treated as file names.

Definition at line 142 of file Logging.py.

Referenced by TestSupport.Logging.errorHTML().

◆ warning()

def TestSupport.Logging.warning (   message,
  stack = False,
  type = '',
  depth = 0 
)

Put a warning to the log.

Parameters
messageThe message to print.
stackDetermines whether a stack trace is included.
typeThe type of message. Used internally to identify messages.

Definition at line 99 of file Logging.py.

Referenced by TestCenterAdvanced.Master.Master.run(), and TestCenterAdvanced.Master.Master.setPackages().

◆ warningHTML()

def TestSupport.Logging.warningHTML (   message,
  type = '',
  depth = 0 
)

Put a warning to the log while interpreting HTML.

Parameters
messageThe message to print. Any HTML tags inside are parsed as such.
typeThe type of message. Used internally to identify messages.

Definition at line 110 of file Logging.py.

Variable Documentation

◆ gStopOnFirstError

bool TestSupport.Logging.gStopOnFirstError = False

Definition at line 32 of file Logging.py.

◆ gStopped

bool TestSupport.Logging.gStopped = False

Definition at line 34 of file Logging.py.