[IronPython] Logging module

Michael Foord fuzzyman at voidspace.org.uk
Tue Feb 17 22:55:52 CET 2009


Dan Eloff wrote:
> On Tue, Feb 17, 2009 at 1:18 PM, Shri Borde <Shri.Borde at microsoft.com> wrote:
>
>   
>> So there may still be a perf concern. However, since I am speculating at this point, I will revert to saying >that the simpler solution should be tried first (which you have), and worry about perf only when there is >specific data.
>>
>>     
>
> Why not encapsulate the functionality into a simple function call:
>
> def getsrcfile():
>     global getsrcfile
>     try:
>         return sys._getframe(2).yaddayadda
>     except ValueError:
>         getsrcfile = lambda: None
>         return None
>
> Please correct me if I'm wrong, but that should eliminate the perf concern?
>   

It's not quite structured like that. The patch has been accepted now and 
I think will be fine. If there are any real production issues it can be 
revisited.

Michael

> (Note: I haven't actually looked at the logging module code)
>
> -Dan
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list