[Yum-devel] RFC: logging/output / using "new" functions in all of yum

Tim Lauridsen tim.lauridsen at googlemail.com
Tue Mar 11 08:36:57 UTC 2008


James Antill wrote:
> On Mon, 2008-03-10 at 11:15 -0400, James Antill wrote:
> 
>>  Anyway, I'll try and convert the rest of yum/*.py today and get another
>> patch for people to look at ... with some stats. on what we are using
>> where.
> 
>  So I've done this for **/*.py in the yum git repo., they apply on top
> of each other:
> 
> http://people.redhat.com/jantill/yum/patches/logging-2008-03-07.patch
> http://people.redhat.com/jantill/yum/patches/logging-2008-03-10.patch
> 
> ...I've tested it a bit, with list, search and update (and yumex) ... so
> it at least mostly works but there are a number of lines changed:
> 
>  14 files changed, 512 insertions(+), 452 deletions(-)
> 
>  stats. on usage
>  ---------------
> 
>  This is just within yum, so that we can see what we are using atm. and
> where we might want to cull functions ... here are the stats:
> 
>       0 dbg1  = self.logger.log(DEBUG_1)
>       0 dbg4  = self.logger.log(DEBUG_4)
>       0 info1 = self.logger.log(INFO_1)
>       0 verr  = self.verbose_logger.error()
>       0 vcrit = self.verbose_logger.critical()
> 
>       1 dbg2   = self.logger.log(DEBUG_2)
>       1 dbg3   = self.logger.log(DEBUG_3)
>       1 info2  = self.logger.log(INFO_2)
>       1 vwarn  = self.verbose_logger.warning()
>       3 vdbg3  = self.verbose_logger.log(DEBUG_3)
>       4 vinfo1 = self.verbose_logger.log(INFO_1)
>       6 err    = self.logger.error()
>       9 warn   = self.logger.warning()
>      10 info   = self.logger.info()
>      11 vinfo  = self.verbose_logger.info()
>      12 dbg    = self.logger.debug()
>      17 vdbg1  = self.verbose_logger.log(DEBUG_1)
>      19 vdbg4  = self.verbose_logger.log(DEBUG_4)
>      28 vdbg   = self.verbose_logger.debug()
>      30 vdbg2  = self.verbose_logger.log(DEBUG_2)
>      59 crit   = self.logger.critical()
>      59 vinfo2 = self.verbose_logger.log(INFO_2)
> 

It is a step in the right direction, but i hate some off the names, they
are to short for my taste (i make me think of assembler instructions).
i would like something like

logDebug1-4
logInfo1-2
logCritical
logWarning
logError
etc.

cant we merge the self.logger & self.verbose_logger into one (i cant
recall why there is two logger objects) ?

it look much better in the code and is more descriptive

Tim




More information about the Yum-devel mailing list