[Yum-devel] [PATCH] Add debuglevel -1. BZ 873428, BZ 982088

James Antill james at fedoraproject.org
Thu Jul 11 21:39:05 UTC 2013


On Thu, 2013-07-11 at 05:10 -0400, Zdenek Pavlas wrote:
> >  Changing the API just because we don't know 100% it's used is not
> > great, and there is this in rhn-plugin:
> > 
> >         self.doConfigSetup(debuglevel=self.cfg["debug"])
> 
> I don't see how this is a problem..

 If self.cfg["debug"] == -1, it's just changed it's meaning.

> > ...also exposing the new -1 thing to the command line seems like a bad
> > idea (uses using it and complaining), even if we have to hack something
> > for yum-cron.
> 
> Right, that's not necessary, added just for completeness.

 Yeh.

> >  Can we not just fix the logging sites to use INFO_2 for these drpm
> > msgs?
> 
> Sure, but..
> 
> $ git grep '\.info('|wc -l
> yum: 52
> yum-utils: 105

 Right, some of those might be "wrong" too ... but nobody has complained
about anything other than the drpm messages, and yum-cron has been using
"yum -q" for a long time.
 Also logger.info() can already be turned off by the API, it's just
verbose_logger.info() that can't.

 So just changing the level of those message might be enough, and then
we don't have to do much or worry about anything.

 I guess if you really would prefer to do it this way we could do:

    debug_table = {-5 : __NO_LOGGING,
        -4 : logging.CRITICAL, -3 : logging.ERROR, -2 : logging.WARNING,
        -1 : __NO_LOGGING, 0 : logging.INFO, 1 : INFO_1, 2 : INFO_2,
        3 : logging.DEBUG, 4 : DEBUG_1, 5 : DEBUG_2, 6 : DEBUG_3, 7 : DEBUG_4}

...which keeps almost all the API guarantees/semantics.


More information about the Yum-devel mailing list