TestCenter Reference
TestSupport.Logging Namespace Reference

Package to provide logging functions. More...

Functions

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

Variables

bool gStopOnFirstError = False
 
bool gStopped = False
 

Detailed Description

Package to provide logging functions.

Function Documentation

◆ error()

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

Put an error 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 119 of file Logging.py.

◆ errorHTML()

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 130 of file Logging.py.

◆ getStack()

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 213 of file Logging.py.

◆ info()

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 76 of file Logging.py.

◆ infoHTML()

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 87 of file Logging.py.

◆ setStopped()

TestSupport.Logging.setStopped ( stopped)

Definition at line 33 of file Logging.py.

◆ showDiff()

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 185 of file Logging.py.

References TestSupport.Logging.showFile().

◆ showFile()

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 161 of file Logging.py.

Referenced by TestSupport.Logging.showDiff().

◆ showImage()

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 140 of file Logging.py.

◆ warning()

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 97 of file Logging.py.

◆ warningHTML()

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 108 of file Logging.py.

Variable Documentation

◆ gStopOnFirstError

bool TestSupport.Logging.gStopOnFirstError = False

Definition at line 29 of file Logging.py.

◆ gStopped

bool TestSupport.Logging.gStopped = False

Definition at line 31 of file Logging.py.