tsuna / gohbase

Pure-Go HBase client
Apache License 2.0
736 stars 213 forks source link

Move to log/slog for logging #247

Closed aaronbee closed 4 months ago

aaronbee commented 7 months ago

The Go standard library now provides a good structured logging library in log/slog, also see https://go.dev/blog/slog. We should replace logrus in favor of slog because it is one fewer external dependency and provides an API that other log libraries can and have already built around.

We should allow users to pass in their own *slog.Logger instance via an option when creating the client, and default to using slog.Default(). This gives a lot of flexibility to users to configure the format of the logging output, the verbosity level, how to dynamically set a verbosity, setting default attributes or a group, etc.

To implement this we probably need to keep an *slog.Logger instance in the client struct and any objects the client creates, like the caches and the region server clients.