Skip to content

Add more granularity to the verbosity configuration object #4

@mdb1

Description

@mdb1

Ideally, we want to provide more granularity to the verbose level of the library.

Example:
Instead of:

    public enum Configuration {
        /// Verbose: logs requests/responses to the console based on the associated values.
        case verbose(logRequests: Bool, logResponses: Bool)
        /// Quiet: doesn't log anything.
        case quiet
    }

Use:

    /// Configuration options.
    public enum Configuration {
        /// Verbose: logs requests/responses to the console based on the associated values.
        case verbose(
            requestConfiguration: RequestConfiguration,
            responseConfiguration: ResponseConfiguration
        )
        /// Quiet: doesn't log anything.
        case quiet

        public struct RequestConfiguration {
            var logInternalId: Bool
            var logURL: Bool
            var logHTTPMethod: Bool
            var logHTTPHeaders: Bool
            var logHTTPBody: Bool
        }

        public struct ResponseConfiguration {
            var logInternalId: Bool
            var logURL: Bool
            var logStatusCode: Bool
            var logJSONResponse: Bool
            var logExpectedModel: Bool
            var logDecodingResult: Bool
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions