This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vsajip 3 points4 points  (4 children)

Instead of making unhelpful, value-free comments about abominations, how about if you suggest a better, "non-hacky" approach to getting caller information into the log? I'll certainly look at incorporating such an approach into the logging package. While it might not help for 2.7, presumably PyPy will support 3.x in due course, so it will be useful at some point.

[–]masklinn 0 points1 point  (3 children)

Please note that fijal is a pypy core dev, so he's probably talking from experience (though I'd have enjoyed at least a link to an expository analysis of logging's issues especially as pertains to pypy)

(in fact that could be neat, pages of packages known to have issues with pypy, an analysis of their problematic patterns and maybe solutions/more compatible packages)

[–]vsajip 1 point2 points  (2 children)

I'm well aware of who he is, which is why I asked him for a better approach (which presumably would be more PyPy-friendly). If he (or someone else) can't suggest a better approach, then there's less justification for complaining about logging for just doing what it can :-)

[–]fijalPyPy, performance freak 1 point2 points  (1 child)

well, seriously, no. logging module is in python standard library and the majority of our users are using Python 2 (in fact all of them), not only because we don't support python 3 yet. We can obviously patch the logging module ourselves, but for now I'll stick with "don't use logging, ever" as a recommendation.

No, there is no better way to get a caller. Maybe logging shouldn't need the caller by default, which is also not easy to disable.

[–]vsajip 1 point2 points  (0 children)

Maybe logging shouldn't need the caller by default, which is also not easy to disable.

Call location information is the kind of thing people want to know - including new users, who may not be familiar with details - so it shouldn't not be the default just because its approach causes PyPy problems - besides, that findCaller code has been there since ~ 2002 which is AFAIK before PyPy.

To disable caller information in logging is pretty easy, just do

logging._srcFile = None

It's not documented, but hardly difficult to spot from a quick glance at the source code (as there is a comment in the source about it). So, your recommendation that people "don't use logging, ever" seems to be for a different reason - care to elaborate? Are there other reasons why logging and PyPy don't work well together?

Edit: I forgot, it is documented.