我正在使用 Ruby Selenium-webdriver 编写脚本。运行脚本后,我在控制台上收到以下日志 -
LOG addons.manager: Application has been upgraded
LOG addons.xpi: startup
LOG addons.xpi: Skipping unavailable install location app-system-local
LOG addons.xpi: Skipping unavailable install location app-system-share
LOG addons.xpi: checkForChanges
LOG addons.xpi-utils: Opening database
LOG addons.xpi-utils: Creating database schema
LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile
LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
LOG addons.xpi: New add-on {BBDA0591-3099-440a-AA10-41764D9DB4DB} installed in winreg-app-global
LOG addons.xpi: New add-on fiddlerhook@fiddler2.com installed in winreg-app-global
LOG addons.xpi: Updating database with changes to installed add-ons
LOG addons.xpi-utils: Updating add-on states
LOG addons.xpi-utils: Writing add-ons list
LOG addons.xpi: shutdown
LOG addons.xpi-utils: shutdown
LOG addons.xpi-utils: Database closed
LOG addons.xpi: startup
LOG addons.xpi: Skipping unavailable install location app-system-local
LOG addons.xpi: Skipping unavailable install location app-system-share
LOG addons.xpi: checkForChanges
LOG addons.xpi: No changes found
我不希望将这些日志打印在控制台上,我只想将我的程序返回到 STDOUT 的任何内容打印在控制台上。有什么办法可以阻止 Ruby 中的这些日志?在 Python 中,我们可以使用以下方法执行此操作 -
import traceback
Settings.ActionLogs=False
Settings.InfoLogs=False
Settings.DebugLogs=False