How do I turn off the logging for PhantomJS in Watir-WebDriver?

…衆ロ難τιáo~ 提交于 2019-12-02 05:11:54

问题


I see a lot of logging information for PhantomJS in my ruby (1.8) watir code, i.e INFO messages. How do I turn it off ? I got the Java code from google search but not ruby code. 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

来源:https://stackoverflow.com/questions/28117205/how-do-i-turn-off-the-logging-for-phantomjs-in-watir-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!