FEniCS / ffcx

Next generation FEniCS Form Compiler for finite element forms
https://fenicsproject.org
Other
145 stars 38 forks source link

FFCx swallows all warnings, including warnings raised in DOLFINx #712

Open jorgensd opened 3 weeks ago

jorgensd commented 3 weeks ago

As we have logging.captureWarnings(capture=True) in FFCx init, all warnings (even from other programs) are swallowed. MWE:

import warnings
warnings.warn("test1", RuntimeWarning)

import ffcx

warnings.warn("test2", RuntimeWarning)

returns

/root/shared/debug/import_ffcx.py:2: RuntimeWarning: test1
  warnings.warn("test1", RuntimeWarning)

This means that Deprecation warnings and other warnings added to DOLFINx will never appear, except in the FFCx logger (which is unintuitive).