-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSLogWriter not working properly (#381)
* Replacing usage of private API with public API, by switching to cInterop. Fixes issue #339 * Update build.gradle.kts --------- Co-authored-by: Kevin Schildhorn <[email protected]>
- Loading branch information
1 parent
e87d7da
commit a38320f
Showing
6 changed files
with
42 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package = co.touchlab.kermit.darwin | ||
--- | ||
|
||
#include <os/log.h> | ||
|
||
/** | ||
* Passing `os_log_t` between this file and a normal kotlin file isn't working correctly. | ||
* There's a weird type mismatch: | ||
* - from here: os_log_t = CPointer<os_log_s> | ||
* - normal kotlin: os_log_t = NSObject? | ||
* For now we're just avoiding the issue by using a generic pointer. | ||
*/ | ||
typedef void* darwin_os_log_t; | ||
|
||
darwin_os_log_t darwin_log_create(const char *subsystem, const char *category) { | ||
return os_log_create(subsystem, category); | ||
} | ||
|
||
void darwin_log_with_type(darwin_os_log_t log, os_log_type_t type, const char *msg) { | ||
os_log_with_type((os_log_t)log, type, "%s", msg); | ||
} |