getlogbook / logbook

A cool logging replacement for Python.
http://logbook.readthedocs.org
Other
1.48k stars 165 forks source link

TicketingHandler MySQL 8.0 encode warning #301

Closed halexan closed 5 years ago

halexan commented 5 years ago

Hi,

When I use TicketingHandler with MySQL 8. A warning is raised, like this

Warning: (3719, "'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.")

It seems that MySQL 8 has switched from UTF8MB3 to UTF8MB4 as the default charset. So how to remove this warning?

My code is as follows:

from logbook.ticketing import TicketingHandler

<...>

db_handler = TicketingHandler(
    uri="mysql+pymysql://{user}:{password}@{host}/mr?charset=utf8".format(
        user=db_user, password=db_password, host=db_host
     ),
    level=db_log_level,
    bubble=True,
)

<...>