kombu icon indicating copy to clipboard operation
kombu copied to clipboard

Use logger for "Restoring X unacknowledged message(s)"

Open blueyed opened this issue 7 years ago • 2 comments

I am seeing logged warnings via celery.redirected that are coming from kombu's print: https://github.com/celery/kombu/blob/09bd23bbd83344b09cbf38b7257107e560db9f25/kombu/transport/virtual/base.py#L285-L292.

Is there a reason why this prints to stderr directly, instead of using the logger?

blueyed avatar May 22 '18 11:05 blueyed

Good observation. git blame does not show any particular reason, my guess is that it was mostly to ensure that these messages will be reported, in case the logger is not correctly setup. I believe they could be converted to logger.error.

georgepsarakis avatar May 26 '18 12:05 georgepsarakis

This has bitten us too. It looks like there are a lot of places in kombu where print is used instead of a logger, and it makes it impossible to handle them as a structured log.

And if you've got your logging set up to only do structured logging, you'll likely miss it entirely.

risicle avatar Feb 05 '24 15:02 risicle