How to supress snappy log

import snappy dumps a lot of logs on the console.
ex)

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.

Otherwise, using methods of snappy dumps noisy logs.

I want to supress logs of snappy.

Thank you.

You can try what is mentioned in this post:

Either use the system property or you can migrate the provided code to python.

2 Likes

@marpet

Thank you for helpful information!
I could supress snappy log starting with 'INFO: ', by following code.

from snappy import Engine
config = Engine.getInstance().getConfig()
config.logLevel('CRITICAL')

Note: this snippet cannot supress log of importing snappy.

However, snappy yet dumps log like '100% done.` executing GPF.createProduct().
How to supress this logs?

Thank you.

1 Like

The percentage output is not using the logging.
To suppress this too, you can do the following:

1 Like