How can I silence the Yum Python API module output? -


is there way prevent yum api creating output when runs?

for instance, if run simple code (with yum-3.4.3-132.el7.centos.0.1):

import yum yb = yum.yumbase() yb.repos.populatesack(mdtype='metadata', cacheonly=0) 

i following output:

loaded plugins: fastestmirror 

i don't want blackhole all output, output yum api.

i looked rhel7 yum code , believe can in code so:

import logging logger = logging.getlogger("yum.verbose.yumplugins") # print critical logs yum logger.setlevel(logging.critical)  # "loaded plugins:" text printed debug. above # logging.debug should silence 

Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -