需要从行为步骤文件中打印日志

Need to print logs from behave step files

我正在尝试打印 python 行为步骤文件中的 - 打印语句,同时我不想打印回溯错误。我使用 behave.ini 文件和 stdout_capture=False 设置。它有助于在步骤文件中打印打印语句,但同时也会打印回溯错误。我不想打印它,只想输出步骤文件中提到的打印语句。有什么办法吗?

我使用了以下命令。 行为 exmaple.feature --logging-level= 错误

尝试将此添加到 behave.ini
stderr_capture = 没有

参考以下文档:https://github.com/behave/behave/blob/master/docs/behave.rst#configuration-files