OpenMS / pyopenms-docs

pyOpenMS readthedocs documentation, additional utilities, addons, scripts, and examples.
https://pyopenms.readthedocs.io
Other
42 stars 50 forks source link

Verbosity level #375

Closed PierreSnell closed 1 year ago

PierreSnell commented 1 year ago

Describe the problem you encountered PyOpenMS is logging too much text for a production library and there is no way to reduce the verbosity.

To Reproduce Steps to reproduce the behavior:

  1. Load an experiment
  2. Run mass trace detection or elution peakdetection or similar algorithms
  3. See :
    Progress of 'mass trace detection':
    -- done [took 0.03 s (CPU), 0.02 s (Wall)] -- 
    Progress of 'elution peak detection':
    -- done [took 0.08 s (CPU), 0.02 s (Wall)] -- 
    Progress of 'assembling mass traces to features':
    -- done [took 0.04 s (CPU), 0.02 s (Wall)] -- 

I'm converting thousands of files and I got all of the output from pyopenms where my logging get drown in the rest.

What should be happening Having a handle on the logger so we can do something like :

import logging
logging.getLogger("PyopenmsLoggerName").setLevel(ERROR)

or something similar like from pyopenms import setDebugLevel; setDebugLevel(ERROR)

System information:

jpfeuffer commented 1 year ago

Can be done with pyopenms.LogConfigHandler().setLogLevel("INFO") or any other level now.

Note there are still some limitations: https://github.com/OpenMS/OpenMS/issues/6827