Closed IanTaylorFB closed 5 months ago
Oof yeah it looks like we've only added tests for AsyncBoundLogger (that is kinda deprecated) but not to the vanilla a.*()
methods. 😳
I'll see what I can do. As for your 2 point: as long as your loggers don't block a lot on IO, the benefits of async logging is dubious at best, but people asked for it a lot and it might improve further with free-threading.
It appears that the async logger calls (
adebug
,ainfo
, ...) are unable to access the correct stack frame / call site parameters because the calls are dispatched viaconcurrent.futures.thread
.I need compatibility with
stdlib logging
as well asstructlog
, and I do need function names and line numbers, so here's my mre, using Python 3.11.8 andstructlog
24.1.0:And the output is like this:
You can see the async call reports the function and line number from
concurrent.futures.thread
, instead of the function and line number from the mre.Questions:
Thanks for any insights!