Python Debug logging

news.sydney.pipenetworks.com nytimes at swiftdsl.com.au
Tue Mar 15 22:47:16 EST 2005


gf gf wrote:
> Is there a simple way to log to a debug console in
> Python?
> 
> In .NET, you can Debug.Write(str), which does nothing
> if there is no debug console open, but, if there is,
> debugs the message.  Is there something similar?
> 
> Alternatively, is there a very simple log4j type
> setup?  I emphasize very simple, since, for me, having
> to go through all the log4j xml configuration defeats
> the purpose of coding quickly in python anyway... I'm
> looking for something along the lines of log4p(DEBUG,
> str) and then just a one line config somewhere
> log4p.DEBUG=stderr or =/dev/null
> 
> Anything like this?

Try googling for "python logging". YOu can try search this newsgroup as 
well. It's the least you can do before posting.

Huy



More information about the Python-list mailing list