Robot Framework
robot.api.logger Namespace Reference

Functions

def console (msg, newline=True, stream='stdout')
 Writes the message to the console. More...
 
def debug (msg, html=False)
 Writes the message to the log file using the DEBUG level. More...
 
def error (msg, html=False)
 Writes the message to the log file using the ERROR level. More...
 
def info (msg, html=False, also_console=False)
 Writes the message to the log file using the INFO level. More...
 
def trace (msg, html=False)
 Writes the message to the log file using the TRACE level. More...
 
def warn (msg, html=False)
 Writes the message to the log file using the WARN level. More...
 
def write (msg, level='INFO', html=False)
 Writes the message to the log file using the given level. More...
 

Function Documentation

◆ console()

def robot.api.logger.console (   msg,
  newline = True,
  stream = 'stdout' 
)

Writes the message to the console.

If the ``newline`` argument is ``True``, a newline character is
automatically added to the message.

By default the message is written to the standard output stream.
Using the standard error stream is possibly by giving the ``stream``
argument value ``'stderr'``.

Definition at line 139 of file logger.py.

◆ debug()

def robot.api.logger.debug (   msg,
  html = False 
)

Writes the message to the log file using the DEBUG level.

Definition at line 104 of file logger.py.

◆ error()

def robot.api.logger.error (   msg,
  html = False 
)

Writes the message to the log file using the ERROR level.

Definition at line 126 of file logger.py.

◆ info()

def robot.api.logger.info (   msg,
  html = False,
  also_console = False 
)

Writes the message to the log file using the INFO level.

If ``also_console`` argument is set to ``True``, the message is
written both to the log file and to the console.

Definition at line 113 of file logger.py.

◆ trace()

def robot.api.logger.trace (   msg,
  html = False 
)

Writes the message to the log file using the TRACE level.

Definition at line 99 of file logger.py.

◆ warn()

def robot.api.logger.warn (   msg,
  html = False 
)

Writes the message to the log file using the WARN level.

Definition at line 120 of file logger.py.

◆ write()

def robot.api.logger.write (   msg,
  level = 'INFO',
  html = False 
)

Writes the message to the log file using the given level.

Valid log levels are ``TRACE``, ``DEBUG``, ``INFO`` (default), ``WARN``, and
``ERROR``. Additionally it is possible to use ``HTML`` pseudo log level that
logs the message as HTML using the ``INFO`` level.

Instead of using this method, it is generally better to use the level
specific methods such as ``info`` and ``debug`` that have separate
``html`` argument to control the message format.

Definition at line 84 of file logger.py.