Revist user Logging configuration for connections and clients
NOTE: This description no longer accurately reflects the changes made after discussions during the review process. See the final changes with commit https://gitlab.com/Mordil/swift-redi-stack/commit/209ba87bf53445ab92c0c1dc6ab5c4a7845a3b86
Motivation:
Logging is more dynamic in real world usage than the current static heavy API allows.
Users generally want to be capable of updating connection logger metadata to attach dynamic properties such as an HTTP request ID for log tracing.
Modifications:
- Add
logger: Logging.Logger
requirement toRedisClient
- Add new
RedisLoggingPreference
enum to let users specify how to handle logging - Add
logging(to:)
andsetLogging(to:)
methods toRedisClient
- Move all log statements to
RedisConnection
- Rename
logger:
parameter arguments(s) tologgingPreference:
- Change when
RedisConnection.init
logging and metric calls are made
Result:
Users should have infinitely more flexibility in how RedisConnection, and RedisClient implementations in general, behave in regards to logging.
Edited by Nathan Harris