Skip to content

Commit 95a288a

Browse files
authored
feat(ios): add fatal issue reporting init to objc (#438)
Adds * +[CAPLogger initFatalIssueReporting] * +[CAPLogger initFatalIssueReportingWithType:] and the associated enum type (CAPIssueReportingType)
1 parent a6a33bc commit 95a288a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

platform/swift/source/LoggerObjc.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
import Foundation
99

10+
@objc(CAPIssueReporterType)
11+
public enum IssueReporterTypeObjc: Int8 {
12+
case builtIn
13+
case customConfig
14+
}
15+
1016
// Make this class not available to Swift code. It should be used by Objective-c code only.
1117
@available(swift, obsoleted: 1.0)
1218
@objc(CAPLogger)
@@ -48,6 +54,27 @@ public final class LoggerObjc: NSObject {
4854
}
4955
}
5056

57+
/// Initializes the issue reporting mechanism. Must be called prior to `Logger.start()`
58+
/// This API is experimental and subject to change
59+
@objc
60+
public static func initFatalIssueReporting() {
61+
Capture.Logger.initFatalIssueReporting(.builtIn)
62+
}
63+
64+
/// Initializes the issue reporting mechanism. Must be called prior to `Logger.start()`
65+
/// This API is experimental and subject to change
66+
///
67+
/// - parameter type: mechanism for crash detection
68+
@objc
69+
public static func initFatalIssueReporting(withType type: IssueReporterTypeObjc) {
70+
switch type {
71+
case .builtIn:
72+
Capture.Logger.initFatalIssueReporting(.builtIn)
73+
case .customConfig:
74+
Capture.Logger.initFatalIssueReporting(.customConfig)
75+
}
76+
}
77+
5178
/// Defines the initialization of a new session within the current configured logger.
5279
/// If no logger is configured, this is a no-op.
5380
@objc

0 commit comments

Comments
 (0)