如何在Watir-WebDriver中关闭PhantomJS的日志记录?

时间:2015-01-23 19:22:47

标签: ruby phantomjs watir watir-webdriver

我在我的ruby(1.8)watir代码中看到了很多PhantomJS的日志信息,即INFO消息。我该如何关闭它?我从谷歌搜索获得了Java代码,但没有得到ruby代码。 Java PhantomJSDriver disable all logs in console

PhantomJS is launching GhostDriver...
[INFO  - 2015-01-27T10:00:00.000Z] GhostDriver - Main - running on port 8910
[INFO  - 2015-01-27T10:00:00.000Z] Session [30344df0-a7de-11e4-9220-5bf7aac4a098] - _decorateNewWindow - page.settings: {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.1 Sa
fari/534.34","webSecurityEnabled":true}
[INFO  - 2015-01-27T10:00:00.000Z] Session [30344df0-a7de-11e4-9220-5bf7aac4a098] - page.customHeaders:  - {}
[INFO  - 2015-01-27T10:00:00.000Z] Session [30344df0-a7de-11e4-9220-5bf7aac4a098] - CONSTRUCTOR - Desired Capabilities: {"javascriptEnabled":true,"rotatable":false,"version":"","takesScreenshot":true,"cssSelectorsEnabled":true,"browserName":"phantomjs","nativeEvents":false,"platform":"ANY"}
[INFO  - 2015-01-27T10:00:00.000Z] Session [30344df0-a7de-11e4-9220-5bf7aac4a098] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.1","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"windows-7-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":f
alse,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO  - 2015-01-27T10:00:00.000Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 30344df0-a7de-11e4-9220-5bf7aac4a098



# All your code print statements go here !




[INFO  - 2015-01-27T10:00:00.000Z] ShutdownReqHand - _handle - About to shutdown

0 个答案:

没有答案