getlogbook / logbook

A cool logging replacement for Python.
http://logbook.readthedocs.org
Other
1.48k stars 165 forks source link

Implement push/pop context for AsyncIO #290

Closed matan129 closed 5 years ago

matan129 commented 5 years ago

In continuation of #268, I fixed some flaws in the original implementation. Also, I fixed some other things along the way, hope it's not too messy.

Tests included.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.5%) to 76.854% when pulling cf3f610030da5bacb5b0c5a214cef7f6efbaa41e on matan129:contextvars2 into ed8ab81fbee261bcfd17bb0130338ab4d9b729b0 on getlogbook:develop.

vmalloc commented 5 years ago

Looks great! I haven't tried to run it with an actual asyncio code that attempts to manipulate contexts, but I trust that you have. I added a few minor comments, and I'll merge it once it's done

matan129 commented 5 years ago

I've fixed everything you requested. I suggest that you squash-merge this PR, or if you want, I can do an interactive rebase and make the commits look nicer. (I didn't do it yet so it'd be easier for you to review)

vmalloc commented 5 years ago

I haven't forgotten about this - just having a rather busy week. Will take a closer look when I get the chance. Thanks!

vmalloc commented 5 years ago

Hi @matan129 Please rebase and squash commits while separating the "aesthetic" ones (like whitespaces/travis/badge changes from the actual contextvar support code.

Also if you can add a changelog entry for this change that would be great.

Thanks!

matan129 commented 5 years ago

Done. I added the changelog entry under v1.5.0, I hope that's okay.

vmalloc commented 5 years ago

Great. Thanks a lot!