Skip to content

Commit e7bb2db

Browse files
committed
feat: Add cURL logging component to LoggingComponents
1 parent f46bf68 commit e7bb2db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SwiftAPIClient/Types/LoggingComponent.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public struct LoggingComponents: OptionSet {
1717
public static let query = LoggingComponents(rawValue: 1 << 8)
1818
public static let uuid = LoggingComponents(rawValue: 1 << 9)
1919
public static let location = LoggingComponents(rawValue: 1 << 10)
20-
public static let onRequest = LoggingComponents(rawValue: 1 << 11)
20+
public static let onRequest = LoggingComponents(rawValue: 1 << 11)
21+
public static let cURL = LoggingComponents(rawValue: 1 << 12)
2122

2223
public static var url: LoggingComponents { [.path, .baseURL, .query] }
2324

@@ -102,6 +103,10 @@ public extension LoggingComponents {
102103
message += "\n\(body.relativePath)"
103104
isMultiline = true
104105
}
106+
if contains(.cURL) {
107+
message += "\n\(request.cURL)"
108+
isMultiline = true
109+
}
105110
if isMultiline {
106111
message += "\n--> END"
107112
if contains(.method) {

0 commit comments

Comments
 (0)