mosquito / aio-pika

AMQP 0.9 client designed for asyncio and humans.
https://aio-pika.readthedocs.org/
Apache License 2.0
1.18k stars 186 forks source link

Suppress 'Unexpected connection close' log with RobustConnection #601

Open Dreamsorcerer opened 7 months ago

Dreamsorcerer commented 7 months ago

When using the robust methods, we get an 'Unexpected connection close' error log when the connection gets interrupted. But, given that it automatically reconnects, we don't need to see this at the error level in our logs.

The log comes from aiormq at: https://github.com/mosquito/aiormq/blob/2874e58ead567b6c3cdcbbd5c7b4b4e9363ddc0d/aiormq/connection.py#L563-L567

Maybe aio-pika can suppress that log when in RobustConnection? Then possibly add its own logs, maybe an info-level log when the connection drops, and an error-level log if it gives up retrying the connection or something similar.