[Python-projects] Checker for use of the standard logging module

Sylvain Thénault sylvain.thenault at logilab.fr
Mon Jun 15 09:29:55 CEST 2009


On 14 juin 17:31, Nathaniel Manista wrote:
> > it's fine with me. And hg bundle rocks ;) I've checked it in. What would be
> > great is to have it working on case such as:
> >
> >  logger = logging.getLogger('mylogger')
> >  logger.warn('hop %s' % 'whatever')
> >
> > but that's a start.
> 
> I agree that this would be ideal, but I think doing it correctly requires
> static typing. 

sure, but that's what pylint is already faking with it's static type inference.

> Truth be told, there's a little static typing going on with
> the way the checker currently checks calls to module-level logging methods,
> but it works because programmers who rename or reassign modules after they
> have been imported generally deserve the bad things that they get as a
> result.
> Checking calls to logging methods called on logger instances could possibly
> be done, and done well, but I'm not sure that I'll be the one to do it, or
> when.
 
that was an idea, not a request for you to do it ;)
 
> > Also would you add a note as Martin suggested about
> > why it's worth ?
> >
> 
> I've enhanced the in-code documentation string to include a few words about
> the value of the delayed interpolation form; I hope that this is what you
> and Maarten had in mind. Please find another bundle attached.

perfect, I've pushed this into our repository.
thanks again,
-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the Python-Projects mailing list