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
}
}
Ideally, we want to provide more granularity to the verbose level of the library.
Example:
Instead of:
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 } }