julien-duponchelle / python-mysql-replication

Pure Python Implementation of MySQL replication protocol build on top of PyMYSQL
2.33k stars 679 forks source link

Add error logging for crc32 validation failures. #563

Closed why-arong closed 1 year ago

why-arong commented 1 year ago

Description

This PR add logging for situations where CRC32 validation does not pass.

By monitoring these failures, we can ensure data integrity throughout the application.

why-arong commented 1 year ago

@sean-k1 https://github.com/julien-duponchelle/python-mysql-replication/blob/1d2c8aba5d96ca4573054e51038d9f62b43da9e9/pymysqlreplication/binlogstream.py#L553-L558

How do you feel about not writing the code like logging.log(logging.ERROR, ~~~)? Unless I need to set the log level dynamically, I think logging.error(~~~) is more intuitive, so that's how I wrote it!

sean-k1 commented 1 year ago

@sean-k1

https://github.com/julien-duponchelle/python-mysql-replication/blob/1d2c8aba5d96ca4573054e51038d9f62b43da9e9/pymysqlreplication/binlogstream.py#L553-L558

How do you feel about not writing the code like logging.log(logging.ERROR, ~~~)? Unless I need to set the log level dynamically, I think logging.error(~~~) is more intuitive, so that's how I wrote it!

logging.error is more better👍