Skip to content

Commit b8ad3de

Browse files
authored
chore: Update public comments to Swift style (#6635)
1 parent 6c0b61e commit b8ad3de

File tree

3 files changed

+135
-206
lines changed

3 files changed

+135
-206
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
### Features
3535

3636
- Add SentryDistribution as Swift Package Manager target (#6149)
37+
- Moves SentryClient and SentryHub to be written in Swift (#6627)
3738
- Add option `enablePropagateTraceparent` to support OTel/W3C trace propagation (#6356)
3839
- Move `enableFileManagerSwizzling` from experimental options to top-level options (#6592).
3940
This option is still disabled by default and will be enabled in a future major release.

Sources/Swift/SentryClient.swift

Lines changed: 43 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ import Foundation
44
@objc public final class SentryClient: NSObject {
55
let helper: SentryClientInternal
66

7-
/**
8-
* Initializes a @c SentryClient. Pass in a dictionary of options.
9-
* @param options Options dictionary
10-
* @return An initialized @c SentryClient or @c nil if an error occurred.
11-
*/
7+
/// Initializes a `SentryClient`. Pass in a dictionary of options.
8+
/// - Parameter options: Options dictionary
9+
/// - Returns: An initialized `SentryClient` or `nil` if an error occurred.
1210
@objc public init?(options: Options) {
1311
guard let helper = SentryClientInternal(options: options) else {
1412
return nil
@@ -29,87 +27,74 @@ import Foundation
2927
set { helper.options = newValue }
3028
}
3129

32-
/**
33-
* Captures a manually created event and sends it to Sentry.
34-
* @param event The event to send to Sentry.
35-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
36-
*/
30+
/// Captures a manually created event and sends it to Sentry.
31+
/// - Parameter event: The event to send to Sentry.
32+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
3733
@discardableResult @objc(captureEvent:) public func capture(event: Event) -> SentryId {
3834
helper.capture(event: event)
3935
}
4036

41-
/**
42-
* Captures a manually created event and sends it to Sentry.
43-
* @param event The event to send to Sentry.
44-
* @param scope The scope containing event metadata.
45-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
46-
*/
37+
/// Captures a manually created event and sends it to Sentry.
38+
/// - Parameters:
39+
/// - event: The event to send to Sentry.
40+
/// - scope: The scope containing event metadata.
41+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
4742
@discardableResult @objc(captureEvent:withScope:) public func capture(event: Event, scope: Scope) -> SentryId {
4843
helper.capture(event: event, scope: scope)
4944
}
5045

51-
/**
52-
* Captures an error event and sends it to Sentry.
53-
* @param error The error to send to Sentry.
54-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
55-
*/
46+
/// Captures an error event and sends it to Sentry.
47+
/// - Parameter error: The error to send to Sentry.
48+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
5649
@discardableResult @objc(captureError:) public func capture(error: Error) -> SentryId {
5750
helper.capture(error: error)
5851
}
5952

60-
/**
61-
* Captures an error event and sends it to Sentry.
62-
* @param error The error to send to Sentry.
63-
* @param scope The scope containing event metadata.
64-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
65-
*/
53+
/// Captures an error event and sends it to Sentry.
54+
/// - Parameters:
55+
/// - error: The error to send to Sentry.
56+
/// - scope: The scope containing event metadata.
57+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
6658
@discardableResult @objc(captureError:withScope:) public func capture(error: Error, scope: Scope) -> SentryId {
6759
helper.capture(error: error, scope: scope)
6860
}
6961

70-
/**
71-
* Captures an exception event and sends it to Sentry.
72-
* @param exception The exception to send to Sentry.
73-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
74-
*/
62+
/// Captures an exception event and sends it to Sentry.
63+
/// - Parameter exception: The exception to send to Sentry.
64+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
7565
@discardableResult @objc(captureException:) public func capture(exception: NSException) -> SentryId {
7666
helper.capture(exception: exception)
7767
}
7868

79-
/**
80-
* Captures an exception event and sends it to Sentry.
81-
* @param exception The exception to send to Sentry.
82-
* @param scope The scope containing event metadata.
83-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
84-
*/
69+
/// Captures an exception event and sends it to Sentry.
70+
/// - Parameters:
71+
/// - exception: The exception to send to Sentry.
72+
/// - scope: The scope containing event metadata.
73+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
8574
@discardableResult @objc(captureException:withScope:) public func capture(exception: NSException, scope: Scope) -> SentryId {
8675
helper.capture(exception: exception, scope: scope)
8776
}
8877

89-
/**
90-
* Captures a message event and sends it to Sentry.
91-
* @param message The message to send to Sentry.
92-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
93-
*/
78+
/// Captures a message event and sends it to Sentry.
79+
/// - Parameter message: The message to send to Sentry.
80+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
9481
@discardableResult @objc(captureMessage:) public func capture(message: String) -> SentryId {
9582
helper.capture(message: message)
9683
}
9784

98-
/**
99-
* Captures a message event and sends it to Sentry.
100-
* @param message The message to send to Sentry.
101-
* @param scope The scope containing event metadata.
102-
* @return The @c SentryId of the event or @c SentryId.empty if the event is not sent.
103-
*/
85+
/// Captures a message event and sends it to Sentry.
86+
/// - Parameters:
87+
/// - message: The message to send to Sentry.
88+
/// - scope: The scope containing event metadata.
89+
/// - Returns: The `SentryId` of the event or `SentryId.empty` if the event is not sent.
10490
@discardableResult @objc(captureMessage:withScope:) public func capture(message: String, scope: Scope) -> SentryId {
10591
helper.capture(message: message, scope: scope)
10692
}
10793

108-
/**
109-
* Captures a new-style user feedback and sends it to Sentry.
110-
* @param feedback The user feedback to send to Sentry.
111-
* @param scope The current scope from which to gather contextual information.
112-
*/
94+
/// Captures a new-style user feedback and sends it to Sentry.
95+
/// - Parameters:
96+
/// - feedback: The user feedback to send to Sentry.
97+
/// - scope: The current scope from which to gather contextual information.
11398
@objc(captureFeedback:withScope:) public func capture(feedback: SentryFeedback, scope: Scope) {
11499
helper.captureSerializedFeedback(
115100
feedback.serialize(),
@@ -118,19 +103,14 @@ import Foundation
118103
scope: scope)
119104
}
120105

121-
/**
122-
* Waits synchronously for the SDK to flush out all queued and cached items for up to the specified
123-
* timeout in seconds. If there is no internet connection, the function returns immediately. The SDK
124-
* doesn't dispose the client or the hub.
125-
* @param timeout The time to wait for the SDK to complete the flush.
126-
*/
106+
/// Waits synchronously for the SDK to flush out all queued and cached items for up to the specified timeout in seconds.
107+
/// If there is no internet connection, the function returns immediately. The SDK doesn't dispose the client or the hub.
108+
/// - Parameter timeout: The time to wait for the SDK to complete the flush.
127109
@objc(flush:) public func flush(timeout: TimeInterval) {
128110
helper.flush(timeout: timeout)
129111
}
130112

131-
/**
132-
* Disables the client and calls flush with @c SentryOptions.shutdownTimeInterval .
133-
*/
113+
/// Disables the client and calls flush with `SentryOptions.shutdownTimeInterval`.
134114
@objc public func close() {
135115
helper.close()
136116
}

0 commit comments

Comments
 (0)