touchlab / Kermit

Kermit by Touchlab is a Kotlin Multiplatform centralized logging utility.
https://kermit.touchlab.co
Apache License 2.0
699 stars 40 forks source link

OSLogWriter not working properly #381

Open robbiehanson opened 11 months ago

robbiehanson commented 11 months ago

As mentioned in issue #339, the OSLogWriter doesn't work properly. In particular, it doesn't properly send messages to the OSLog system, and as such, the messages get corrupted within the OSLogStore.

It seems the source of the problem is the use of an internal API: _os_log_internal. Replacing this with a call to the public API os_log_with_type fixes the problem.

However, the standard os_log functions (the public API's that Apple tells you to use) are mysteriously missing from the kotlin-generated headers. So to get around this problem I used a cInterop file.