# Examples from pyvista.vtk_verbosity
# ===================================

# Get the current vtk verbosity.
import pyvista as pv
pv.vtk_verbosity()

# Set verbosity to max.
_ = pv.vtk_verbosity('max')
pv.vtk_verbosity()

# Create a `Sphere()`. Note how many VTK debugging messages are now
# generated as the sphere is created.
mesh = pv.Sphere()

# Use it as a context manager to temporarily turn it off.
with pv.vtk_verbosity('off'):
    mesh = mesh.cell_quality('volume')

# The state is restored to its previous value outside the context.
pv.vtk_verbosity()

# Note that the verbosity state is global and will persist between function
# calls. If the context manager isn't used, the state needs to be reset explicitly.
# Here, we set it back to its default value.
_ = pv.vtk_verbosity('info')

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

