scylladb / scylla-go-driver

Experimental, high performance Scylla Driver, University of Warsaw students' project
Apache License 2.0
151 stars 7 forks source link

session: add log configuration #271

Closed Kulezi closed 2 years ago

Kulezi commented 2 years ago

Right now the driver logs important events to stderr, it should be off by default and configurable by the user through sessionConfig.

Maybe using an interface like gocql: https://github.com/gocql/gocql/blob/v1.2.0/logger.go#L9 or https://github.com/scylladb/go-log

martin-sucha commented 2 years ago

I'd prefer some kind of interface where I can plug a custom implementation. We have an internal logging package (based on zap) that always adds some custom fields.

The driver should also log query warnings by default to the configured logger and allow users to explicitly turn the warnings off if needed. That would make warnings more useful. With gocql probably most people ignore them. (but maybe this is for a separate issue?)