Yes, this should be possible. I haven’t executed the following, but I think it will work.
I’m not sure if the NullOutputStream is accessible from Python, but it should.
This will disable any output.
System = jpy.get_type('java.lang.System')
PrintStream = jpy.get_type('java.io.PrintStream')
NullStream = jpy.get_type('org.apache.commons.io.output.NullOutputStream')
## disable System.out
System.setOut(new PrintStream(new NullStream ()))
## optionally disable System.err too
System.setErr(new PrintStream(new NullStream ()))
You can also disable only the logging (for your WriteOp case)
The following code should do it.
Logger = jpy.get_type('java.util.logging.Logger')
Level = jpy.get_type('java.util.logging.Level')
Logger.getLogger('').setLevel(Level.OFF)
snappy.SystemUtils.LOG.setLevel(Level.OFF)