Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

Support for an async logging #171

Closed diogommartins closed 6 years ago

diogommartins commented 6 years ago

Currently protocol.py and channel.py have their own logger. I use an async logging implementation[1] and it would be nice to have the possibility of nonblocking log calls at aioamqp. What do you guys think about that ? Also, would you be confortable with changing the interfaces of AmqpProtocol an Channel so that it would be possible to pass a logger and remove the global logger ?

[1] https://github.com/B2W-BIT/aiologger

dzen commented 6 years ago

Hello @diogommartins ;

I'm not comfortable with changing all logging calls to a coroutine call : it means breaking the official logger interface. A proper way to interface an asyncio logger should be like this one : https://github.com/aio-libs/aiologstash : they create a new handler responsible for the network stack using asyncio, which abstract the asyncio complexity in the code.

diogommartins commented 6 years ago

Thanks a lot for the feedback, i'm gonna check it out 😁