On 11/22/05, Vinay Sajip <[EMAIL PROTECTED]> wrote: > makeRecord will, after doing what it does now, use the extra_info argument > as follows: > > If type(extra_info) != types.DictType, it will be ignored. > > Otherwise, any entries in extra_info whose keys are not already in the > LogRecord's __dict__ will be added to the LogRecord's __dict__. > > Can anyone see any problems with this approach?
I'd suggest that you raise an error if extra_info doesn't act like a dictionary - probably, just try to add its entries and let any error pass back to the caller. You definitely want to allow dict subclasses, and anything that acts like a dictionary. And you want to catch errors like log(..., extra_info = "whatever") with a format of "... %(extra_info)s..." (ie, assuming that extra_info is a single value - it's what I expected you to propose when I started reading). The rest looks good (I don't have a need for it myself, but it looks like a nice, clean solution to the problem you describe). Paul. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com