Re: fine grain logging cotrol

2007-03-24 Thread Eric S. Johansson
Dennis Lee Bieber wrote: > I've never resorted to the debugger -- it's always been faster for > me to just wolf-fence* code with print statements... depends on the situation for me. normally I use log statements that turn on or off based on predicates (now I need to figure out how to han

Re: fine grain logging cotrol

2007-03-24 Thread Eric S. Johansson
Dennis Lee Bieber wrote: > On Sat, 24 Mar 2007 11:29:34 -0400, "Eric S. Johansson" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> yes. here is the code that fails. I don't understand why the unbound >> method. what is really weird is that when I singlestep through t

Re: fine grain logging cotrol

2007-03-24 Thread Eric S. Johansson
Dennis Lee Bieber wrote: > On Fri, 23 Mar 2007 21:15:56 -0400, "Eric S. Johansson" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Gabriel Genellina wrote: >> >>> I don't get all the details of what's all that stuff for, but from the >>> error and traceback, I think you f

Re: fine grain logging cotrol

2007-03-23 Thread Eric S. Johansson
Gabriel Genellina wrote: > I don't get all the details of what's all that stuff for, but from the > error and traceback, I think you forgot to create the filter_test > instance. That is, change lgr.addFilter(filter_test) to > lgr.addFilter(filter_test()) do'h . for some reason, I thought a

Re: fine grain logging cotrol

2007-03-23 Thread Gabriel Genellina
En Fri, 23 Mar 2007 19:34:31 -0300, Eric S. Johansson <[EMAIL PROTECTED]> escribió: > class LoggedType(type): > def __new__(mcl, name, bases, classdict): > def get_logger(self): > tag = "%s.%s" % (name,sys._getframe(1).f_code.co_name) > lgr = logging.getLo

Re: fine grain logging cotrol

2007-03-23 Thread Eric S. Johansson
Peter Otten wrote: > Eric S. Johansson wrote: > > Here is yet another revision of my example then: it's making more and more sense although I don't quite follow 'property' quite yet. But I see that get_logger is invoked prior to the __logger.info call. I was looking at how to implement one of

Re: fine grain logging cotrol

2007-03-23 Thread Peter Otten
Eric S. Johansson wrote: > Peter Otten wrote: >> Eric S. Johansson wrote: >> >> [in private mail -- please don't, Eric] > > sorry. my preference is for private mail. it's my way of trying to be > kind to others by reducing list clutter. It is not list clutter in my book; it gives others the c

Re: fine grain logging cotrol

2007-03-23 Thread Eric S. Johansson
Peter Otten wrote: > Eric S. Johansson wrote: > > [in private mail -- please don't, Eric] sorry. my preference is for private mail. it's my way of trying to be kind to others by reducing list clutter. > I don't understand. The logging package detects the function name without > user intervent

Re: fine grain logging cotrol

2007-03-22 Thread Peter Otten
Eric S. Johansson wrote: [in private mail -- please don't, Eric] > Peter Otten wrote: > > > As a general direction try to understand the logging package, the > > __new__() method (a constructor in C++), and metaclasses (a class is > > an instance of another class which is called metaclass to avo

Re: fine grain logging cotrol

2007-03-22 Thread Peter Otten
Eric S. Johansson wrote: > Peter Otten wrote: >> Eric S. Johansson wrote: >> >>> I need to to be able to conditionally log based on the method the log >>> statement is in and one other factor like a log level. in order to do >>> so, I need to be able to automatically find out the name of the met

Re: fine grain logging cotrol

2007-03-22 Thread Eric S. Johansson
Peter Otten wrote: > Eric S. Johansson wrote: > >> I need to to be able to conditionally log based on the method the log >> statement is in and one other factor like a log level. in order to do >> so, I need to be able to automatically find out the name of the method >> and its class but I haven'

Re: fine grain logging cotrol

2007-03-22 Thread Peter Otten
Eric S. Johansson wrote: > I need to to be able to conditionally log based on the method the log > statement is in and one other factor like a log level. in order to do > so, I need to be able to automatically find out the name of the method > and its class but I haven't found out how to do that

fine grain logging cotrol

2007-03-22 Thread Eric S. Johansson
I need to to be able to conditionally log based on the method the log statement is in and one other factor like a log level. in order to do so, I need to be able to automatically find out the name of the method and its class but I haven't found out how to do that yet. for example, class catus

Re: fine grain logging cotrol

2007-03-22 Thread Steve Holden
Eric S. Johansson wrote: > I need to to be able to conditionally log based on the method the log > statement is in and one other factor like a log level. in order to do > so, I need to be able to automatically find out the name of the method > and its class but I haven't found out how to do tha