improvements for the logging package

Trent Mick trentm at ActiveState.com
Tue Sep 6 13:24:18 EDT 2005


[Rotem wrote]
> while working on something in my current project I have made several
> improvements to the logging package in Python, two of them are worth
> mentioning:
> 1. addition of a logging record field %(function)s, which results in
> the name
> of the entity which logged the record. My version even deduces the
> class name in the case which the logger is a bound method, and assuming
> the name of the "self" variable is indeed "self".
> 
> This ability can be turned off, for performance reasons, and is useful
> for debugging phases.
> 
> 2. log coloring formatter (useful for console output) - support for log
> lines like BLUE<<text>>, etc.
> 
> Now, I asked several friends of mine who program in Python often, and
> they told me they could use these features very much.
> 
> I'm taking a risk here, that maybe someone already proposed this in
> this group, but I'll ask either way:
> Has anyone thought of posting a PEP about this? Do you think I should?

Cool. Your additions sound useful.
This might be a bit small for a PEP (though I am hardly an authority).
You could post your patch on a new bug on SourceForge.

    http://sourceforge.net/tracker/?group_id=5470

> I have made a great use of the logging package, and would certainly
> like to see it evolve and include more features.

Something to consider that would help to get the logging package more
used would be to write up your experiences with it: write a tutorial or
HOWTO or improvements of the core logging docs. Currently the logging
package looks fairly uninviting/untractable to new users.

Cheers
Trent

-- 
Trent Mick
TrentM at ActiveState.com



More information about the Python-list mailing list