5 Commits

Author SHA1 Message Date
Nathan Harris b88fac059d #115 -- Remove logging(to:) method 2022-12-01 13:06:35 -06:00
Nathan Harris 03a066f8f5 Audit log message severity levels
Motivation:

Following the SSWG guidelines for libraries and log levels, because much of the library's behavior is expressed in the language and NIO framework as errors and failed ELFs, logging at error is "verbose" and takes away control from developers.

Modifications:

Log messages have been adjusted to more accurately represent when and how the log message should be used, especially when ELFs are failed or errors are thrown.

Result:

Developers won't have log messages at error or critical unless they opt-in from their own code, unless the library has no way of expressing the failure condition through the language.
2021-04-08 20:22:10 -07:00
Nathan Harris 90244e327b Refactor Logging implementation
Motivation:

The original implementation of Logging was done in more haste than should have been, without proper attention given to the semantic requirements.

As the Swift ecosystem has matured a bit, lessons have been learned on handling metadata and passing of external context into internal subcomponents.

A mixture of the "protocol-based context passing" and "explicit context passing" patterns have been adopted.

Both patterns are more fully described in the Swift forum discussion: https://forums.swift.org/t/the-context-passing-problem/39162

Modifications:

- Add: `RedisLogging` namespace with references to static keys and labels that are used for Logging throughout the library
- Add: `Logger` static computed properties to access the Logger prototypes used in connection and connection pools
- Add: `RedisClientWithUserContext` protocol and `UserContextRedisClient` types to assist with wrapping client types for custom logger contexts
- Remove: `logger` property from `RedisClient` requirements
- Change: Many log statements to have higher or lower log levels for their appropriate context
- Change: `RedisConnection` and `RedisConnectionPool` to conform to `RedisClientWithUserContext`
- Change: `logging(to:)` protocol requirement to return a `RedisClient` existential
- Change: ConnectionPool to explicitly pass a logger instance around for pooling methods

Result:

Logging in RediStack will now have a stronger contract of where and how logs will be generated and which context will be used.

Fixes #79 and #74
2020-08-31 22:07:59 -07:00
Nathan Harris f2df346097 Update Jazzy Doc Generation Script
Motivation:

Up until now, Jazzy docs were generated on a private CI runner hosting macOS - which doesn't make CI portable as it requires that runner to always be available.

Modifications:

- Change: CI config to use a Linux Jazzy Docker image for portability
- Change: Doc theme templates to not reference GitHub

Result:

Jazzy docs should be able to be generated at any time, as the CI infrastructure is using GitLab's cloud solution with a Docker image
2019-07-08 20:36:04 -07:00
Nathan Harris dd839fdf02 45 -- Add API Documentation
Motivation:

Users need a quick reference available online that is up to date.

Modifications:

Add CI job to generate and publish API docs with Jazzy

Result:

Users can view API docs that are updated when new releases are tagged at https://mordil.gitlab.io/swift-redis-nio-client
2019-06-06 17:17:29 -07:00