Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the new installation and configuration mechanism #499

Merged
merged 21 commits into from
Jun 18, 2024

Conversation

GLinnik21
Copy link
Collaborator

@GLinnik21 GLinnik21 commented Jun 11, 2024

As suggested by @naftaly in #491 (comment)

@GLinnik21 GLinnik21 mentioned this pull request Jun 11, 2024
*
* **Default**: NULL
*/
@property (nonatomic, copy, nullable) void (^crashNotifyCallback)(const struct KSCrashReportWriter* writer);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the "ugly" API for Swift. KSCrashReportWriter is a struct that deeply integrated in KSCrash and used in callback, that makes it hard to proxy.
Visible to Swift:

open var crashNotifyCallback: ((UnsafePointer<KSCrashReportWriter>) -> Void)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping this in an ObjC class would be a really good thing to have. Swift API matters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From docs

 * WARNING: Only call async-safe functions from this function! DO NOT call
 * Objective-C methods!!!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Well, it's fine then.
I'm thinking that a wrapper with all methods being __attribute__((objc_direct)) might do the trick, but it's still ObjC.

*
* **Default**: NULL
*/
@property (nonatomic, copy, nullable) void (^crashNotifyCallback)(const struct KSCrashReportWriter* writer);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping this in an ObjC class would be a really good thing to have. Swift API matters.

Sources/KSCrashRecording/include/KSCrashCConfiguration.h Outdated Show resolved Hide resolved
Base automatically changed from injectable-monitors to master June 16, 2024 22:24
@GLinnik21 GLinnik21 marked this pull request as ready for review June 17, 2024 13:31
@GLinnik21 GLinnik21 requested a review from bamx23 June 17, 2024 15:37
Sources/KSCrashInstallations/KSCrashInstallation.m Outdated Show resolved Hide resolved
Sources/KSCrashRecording/include/KSCrash.h Outdated Show resolved Hide resolved
Sources/KSCrashRecording/KSCrash.m Show resolved Hide resolved
Sources/KSCrashRecording/KSCrashConfiguration.m Outdated Show resolved Hide resolved
Copy link
Collaborator

@bamx23 bamx23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments. This new way of initialization makes perfect sense here. And as mentioned in another PR, let's update README later to have actual usage instructions.

Sources/KSCrashRecording/KSCrash.m Show resolved Hide resolved
@GLinnik21 GLinnik21 merged commit 5bf291d into master Jun 18, 2024
19 checks passed
@GLinnik21 GLinnik21 deleted the crash-config branch June 18, 2024 13:20
@GLinnik21 GLinnik21 added this to the 2.0.0 milestone Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants