2

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
Community
  • 1
  • 1
stack1
  • 1,004
  • 2
  • 13
  • 28
  • What is the -1 for ? There is no code for this. There can be no code. What have I tried ? I have googled and got a java solution to turn logs off as I already mentioned. – stack1 Jan 24 '15 at 06:13
  • Some people just like to downvote. – orde Jan 26 '15 at 00:02
  • Can you give an example of the messages you are seeing? PhantomJS does not appear to be outputting anything by default for me. – Justin Ko Jan 27 '15 at 13:49
  • @JustinKo - I tried to peek into the source code using the instructions for java and js as a clue. I wasted 2 hours and found nothing like STDOUT, console, log etc. which could be commented out to fix this issue. – stack1 Jan 29 '15 at 18:03
  • Just to make sure I am trying to reproduce the right issue, these logs are generated when simply doing `Watir::Browser.new :phantomjs`? – Justin Ko Jan 29 '15 at 18:22
  • @JustinKo - Wow ! Thats good. To test that, I put print statements before and after the my code `browser = Watir::Browser.new :phantomjs`. Only the before print statement shows output, code executes correctly and ends. Why does this happen ? – stack1 Jan 29 '15 at 18:40
  • watir uses webdriver to talk to phantomjs.. webdriver communicates with phantomjs via ghostdriver. The docs for ghostdriver stuff are (I am told) part of the webdriver project. try looking there for options perhaps? – Chuck van der Linden May 20 '15 at 17:02
  • @ChuckvanderLinden - Please tell me where I can look for the options you mentioned. thanks. – stack1 May 30 '15 at 21:20

0 Answers0