A suggestion for an easy logger

Vinay Sajip vinay_sajip at yahoo.co.uk
Sat May 7 22:27:17 EDT 2011


On May 8, 1:00 am, mcilrain <noah.mcilra... at gmail.com> wrote:
> Aside from the fact that it's very Javay, what's wrong with theloggingmodule?

It's not especially Java-like. Since you can log using just

import logging

logging.basicConfig(level=logging.DEBUG)
logging.debug('This is %sic, not %s-like - that's FUD', 'Python',
'Java')

it doesn't seem especially Java-like: no factories, Interfaces,
builders, using plain functions etc.

The second line is optional and needed only if you want to log DEBUG
or INFO messages (as the default threshold is WARNING).

Despite other logging libraries claiming to be more Pythonic, they
have pretty much the same concepts as stdlib logging - because those
concepts are tied to logging, not to Java. Call it correlation vs.
causation, or convergent evolution, or what you will.

Regards,

Vinay Sajip



More information about the Python-list mailing list