robot.output package
Package for internal logging and other output.
Not part of the public API, and also subject to change in the future when test execution is refactored.
Subpackages
Submodules
robot.output.debugfile module
robot.output.filelogger module
- class robot.output.filelogger.FileLogger(path, level)[source]
Bases:
AbstractLogger
,LoggerApi
robot.output.librarylogger module
Implementation of the public logging API for libraries.
This is exposed via robot.api.logger
. Implementation must reside
here to avoid cyclic imports.
robot.output.listeners module
- class robot.output.listeners.Listeners(listeners: Iterable[str | Any] = (), log_level: LogLevel | str = 'INFO')[source]
Bases:
object
- property listeners
- class robot.output.listeners.LibraryListeners(log_level: LogLevel | str = 'INFO')[source]
Bases:
Listeners
- property listeners
- class robot.output.listeners.ListenerFacade(listener, name, log_level, library=None)[source]
Bases:
LoggerApi
,ABC
- class robot.output.listeners.ListenerV3Facade(listener, name, log_level, library=None)[source]
Bases:
ListenerFacade
- class robot.output.listeners.ListenerV2Facade(listener, name, log_level, library=None)[source]
Bases:
ListenerFacade
robot.output.logger module
- class robot.output.logger.Logger(register_console_logger=True)[source]
Bases:
AbstractLogger
A global logger proxy to delegating messages to registered loggers.
Whenever something is written to LOGGER in code, all registered loggers are notified. Messages are also cached and cached messages written to new loggers when they are registered.
NOTE: This API is likely to change in future versions.
- property start_loggers
- property end_loggers
- register_console_logger(type='verbose', width=78, colors='AUTO', links='AUTO', markers='AUTO', stdout=None, stderr=None)[source]
- property cache_only
- property delayed_logging
robot.output.loggerapi module
- class robot.output.loggerapi.LoggerApi[source]
Bases:
object
- start_user_keyword(data: running.Keyword, implementation: running.UserKeyword, result: result.Keyword)[source]
- end_user_keyword(data: running.Keyword, implementation: running.UserKeyword, result: result.Keyword)[source]
- start_library_keyword(data: running.Keyword, implementation: running.LibraryKeyword, result: result.Keyword)[source]
- end_library_keyword(data: running.Keyword, implementation: running.LibraryKeyword, result: result.Keyword)[source]
- start_invalid_keyword(data: running.Keyword, implementation: running.KeywordImplementation, result: result.Keyword)[source]
- end_invalid_keyword(data: running.Keyword, implementation: running.KeywordImplementation, result: result.Keyword)[source]
- log_message(message: model.Message)[source]
- message(message: model.Message)[source]
- output_file(path: Path)[source]
Called when XML output file is closed.
Calls
result_file()
by default.
- report_file(path: Path)[source]
Called when report file is closed.
Calls
result_file()
by default.
- log_file(path: Path)[source]
Called when log file is closed.
Calls
result_file()
by default.
- xunit_file(path: Path)[source]
Called when xunit file is closed.
Calls
result_file()
by default.
- debug_file(path: Path)[source]
Called when debug file is closed.
Calls
result_file()
by default.
- result_file(kind: Literal['Output', 'Report', 'Log', 'XUnit', 'Debug'], path: Path)[source]
Called when any result file is closed by default.
kind
specifies the file type. This method is not called if a result file specific method likeoutput_file()
is implemented.
robot.output.loggerhelper module
- class robot.output.loggerhelper.Message(message: str | None | Callable[[], str | None] = '', level: Literal['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FAIL', 'SKIP', 'HTML', 'CONSOLE'] = 'INFO', html: bool = False, timestamp: datetime | str | None = None)[source]
Bases:
Message
Represents message logged during execution.
Most messages are logged by libraries. They typically log strings, but possible non-string items have been converted to strings already before they end up here.
In addition to strings, Robot Framework itself logs also callables to make constructing messages that are not typically needed lazy. Such messages are resolved when they are accessed.
Listeners can remove messages by setting the message attribute to None. These messages are not written to the output.xml at all.
- property message: str | None
robot.output.output module
robot.output.pyloggingconf module
- class robot.output.pyloggingconf.RobotHandler(level=0, library_logger=<module 'robot.output.librarylogger' from '/home/docs/checkouts/readthedocs.org/user_builds/robot-framework/checkouts/master/src/robot/output/librarylogger.py'>)[source]
Bases:
Handler
Initializes the instance - basically setting the formatter to None and the filter list to empty.
robot.output.stdoutlogsplitter module
robot.output.xmllogger module
- class robot.output.xmllogger.XmlLogger(output, rpa=False, suite_only=False)[source]
Bases:
ResultVisitor
- generator = 'Robot'
- visit_message(msg)[source]
Implements visiting messages.
Can be overridden to allow modifying the passed in
msg
without callingstart_message()
orend_message()
.
- start_keyword(kw)[source]
Called when a keyword starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_keyword(kw)[source]
Called when a keyword ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_if(if_)[source]
Called when an IF/ELSE structure starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_if(if_)[source]
Called when an IF/ELSE structure ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_if_branch(branch)[source]
Called when an IF/ELSE branch starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_if_branch(branch)[source]
Called when an IF/ELSE branch ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_for(for_)[source]
Called when a FOR loop starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_for(for_)[source]
Called when a FOR loop ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_for_iteration(iteration)[source]
Called when a FOR loop iteration starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_for_iteration(iteration)[source]
Called when a FOR loop iteration ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_try(root)[source]
Called when a TRY/EXCEPT structure starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_try(root)[source]
Called when a TRY/EXCEPT structure ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_try_branch(branch)[source]
Called when TRY, EXCEPT, ELSE or FINALLY branches start.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_try_branch(branch)[source]
Called when TRY, EXCEPT, ELSE and FINALLY branches end.
By default, calls
end_body_item()
which, by default, does nothing.
- start_while(while_)[source]
Called when a WHILE loop starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_while(while_)[source]
Called when a WHILE loop ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_while_iteration(iteration)[source]
Called when a WHILE loop iteration starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_while_iteration(iteration)[source]
Called when a WHILE loop iteration ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_group(group)[source]
Called when a GROUP element starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_group(group)[source]
Called when a GROUP element ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_var(var)[source]
Called when a VAR element starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_var(var)[source]
Called when a VAR element ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_return(return_)[source]
Called when a RETURN element starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_return(return_)[source]
Called when a RETURN element ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_continue(continue_)[source]
Called when a CONTINUE element starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_continue(continue_)[source]
Called when a CONTINUE element ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_break(break_)[source]
Called when a BREAK element starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_break(break_)[source]
Called when a BREAK element ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_error(error)[source]
Called when a ERROR element starts.
By default, calls
start_body_item()
which, by default, does nothing.Can return explicit
False
to stop visiting.
- end_error(error)[source]
Called when a ERROR element ends.
By default, calls
end_body_item()
which, by default, does nothing.
- start_test(test)[source]
Called when a test starts. Default implementation does nothing.
Can return explicit
False
to stop visiting.