为机器人框架中的内置关键字设置日志级别



在机器人框架中,看起来它默认使用"INFO"日志级别记录"="等关键字的消息。前任:

<Test case>
${xyz} = "hello"

将记录消息:

'INFO': ${xyz} = "hello"

我想将其日志级别降低到"调试"或"跟踪",但似乎在源代码中找不到它。 对此有什么建议?

此外,您可以在代码中设置日志级别。喜欢这个:

Test Setup                Set Log Level    TRACE

然后在 log.html 文件中,右上角会显示一个可见的日志级别下拉列表。这允许用户从视图中删除所选级别以下的消息。这在 TRACE 级别运行测试时尤其有用。

有关更多信息,请参阅:http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#visible-log-level

您是否尝试执行测试,将整个执行带到更深层次 "调试"或"跟踪"将此-L trace-L debug添加到测试调用中。robot -L trace mytest.robot例如。

源代码定义如下

def log(self, message, level='INFO', html=False, console=False,
repr=False, formatter='str'):
u"""Logs the given message with the given level.
Valid levels are TRACE, DEBUG, INFO (default), HTML, WARN, and ERROR.
Messages below the current active log level are ignored. See
`Set Log Level` keyword and ``--loglevel`` command line option
for more details about setting the level.

使用示例 记录消息:{消息} 级别=调试

最新更新