private void suppressSeleniumJavaUtilLogging ( ) { if ( ! seleniumLoggingSuppressed . getAndSet ( true ) ) { try { // Log4j logging is annoyingly difficult to turn off, it usually requires a config file but we can also do it with an InputStream Properties properties = new Properties ( ) ; properties . setProperty ( "org.openqa.selenium.remote.ProtocolHandshake.level" , "OFF" ) ; properties . setProperty ( "org.openqa.selenium.remote.ProtocolHandshake.useParentHandlers" , "false" ) ; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; properties . store ( byteArrayOutputStream , "seleniumLoggingProperties" ) ; byte [ ] bytes = byteArrayOutputStream . toByteArray ( ) ; ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream ( bytes ) ; LogManager . getLogManager ( ) . readConfiguration ( byteArrayInputStream ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } }
We don t want that in the Chorus interpreter output by default