Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you disable Cassandra's Python Driver logs?

I'm using Cassandra's Python driver (3.16).

Cassandra spits out a ton of non-essential WARNING logs that clog up my terminal. How can I disable them in my python project?

like image 406
mtical Avatar asked Oct 14 '25 07:10

mtical


1 Answers

Python logging is by modules or classes as we call it outside python.

You can disable logging on a module level using this command:

logging.getLogger('cassandra').setLevel(logging.ERROR)

This will set the logging level to ERROR and will not print logs with level below ERROR.

like image 149
Renjith Bhattathiripad Avatar answered Oct 16 '25 21:10

Renjith Bhattathiripad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!