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.
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 usingslog.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.