gpt4 book ai didi

selenium - 如何在 selenium 3 中关闭 Marionette/gecko 驱动程序日志

转载 作者:行者123 更新时间:2023-12-03 23:02:41 26 4
gpt4 key购买 nike

我需要关闭 Marionette/GeckoDriver 日志记录;有没有办法做到这一点?我一直在寻找很多,但我没有得到正确的答案。
INFO 日志是:

 1484653905833  geckodriver INFO    Listening on 127.0.0.1:15106
Jan 17, 2017 5:21:46 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
1484653906715 mozprofile::profile INFO Using profile path C:\Users\vtiger\AppData\Local\Temp\3\rust_mozprofile.7d2LEwDKoE8J
1484653906720 geckodriver::marionette INFO Starting browser C:\Program Files\Mozilla Firefox\firefox.exe
1484653906731 geckodriver::marionette INFO Connecting to Marionette on localhost:58602
1484653908388 addons.manager DEBUG Application has been upgraded
1484653908843 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1484653908846 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1484653908852 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1484653908855 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1484653908857 addons.manager DEBUG Starting provider: XPIProvider
1484653908857 addons.xpi DEBUG startup
1484653908858 addons.xpi INFO SystemAddonInstallLocation directory

如何关闭此日志记录?

最佳答案

您可以通过系统属性将日志发送到/dev/null 来禁用日志,如下所示:

System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,"/dev/null");

return new FirefoxDriver();

关于selenium - 如何在 selenium 3 中关闭 Marionette/gecko 驱动程序日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41696695/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com