marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
1.98k stars 257 forks source link

how to remove vtk log #1128

Open rookie96 opened 1 month ago

rookie96 commented 1 month ago

i use vedo.Mesh.intersect_with_plane many times.

once i call vedo.Mesh.intersect_with_plane, one vtk log("2024-05-30 16:18:57.450 ( 3.004s) [D74557468B270C7F]vtkPolyDataPlaneCutter.:589 INFO| Executing vtkPolyData plane cutter") appear my console and log files.

how can i remove vtk log?

i tried changing logging.setLevel, logging.disabled, stdout/stderr suppress(https://stackoverflow.com/questions/11130156/suppress-stdout-stderr-print-from-python-functions)

but i still sees many vtk logs

marcomusy commented 1 month ago

Unfortunately this is (if I remember corrctly) an upstream bug from vtk so we cannot do much to fix it..

andrefpf commented 2 days ago

To disable the ~weird~ vtk logs and error messages in my applications I added the following lines just before launching the main code:

vtk.vtkObject.GlobalWarningDisplayOff()
vtk.vtkLogger.SetStderrVerbosity(vtk.vtkLogger.VERBOSITY_OFF)