structlog
structlog copied to clipboard
Add class name support for CallsiteParameterAdder
It may be nice to include support for class name in CallsiteParameterAdder
, not sure how practical/easy it will be though, or how reliable it is to get the class name of the callsite.
Original request from @gzmarstone here: https://github.com/hynek/structlog/pull/380#issuecomment-995873510
I know its closed, but what about class if available as well... use case would be to find all of the logging calls in a particular class... You can check if the first arg is self, if it is then get the class and the name of that? I used this example to log the classname via structlog: https://stackoverflow.com/questions/2203424/python-how-to-retrieve-class-information-from-a-frame-object
Sounds good! There won't be a 21.6 tho!!!! ;)
JFTR, if you wanna tackle this, it might be a good time to start. I'm currently hounding @Tinche to follow through on a promise and would push 22.1 out right after.
JFTR I looked at the linked solutions and holy shit unless we get a better way from Python core, this has to wait. 😅