problems with logging module

Alia Khouri alia_khouri at yahoo.com
Mon Jul 30 08:50:52 CEST 2007


On Jul 30, 8:01 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:

> To see what's going on, try using this old-fashioned debug technique: a
> few print statements.

My bad, problem was solved, the shortcoming was one of my variables
pointing to nothingness (-;

But I'm not letting the logging module off, it's still not the easiest
or most intuitive module to work with.

For example: a basic Log class that can be programatically configured
would be quicker to work with then messing around with three different
classes types if you want to get beyond basicConfig functionality:
(Logger, handlers, formatters) To be able to do this would be nice:

from logging import Log

class MyClass:
    def __init__(self, x):
        self.x = x
        self.log = Log(
            level=logging.DEBUG,
            format="%(asctime)s %(levelname)s: %(message)s",
            datefmt = '%H:%M:%S',
            filename='app.log',
            filemode='a'
        )

Thanks for your help and time.

AK





More information about the Python-list mailing list