From 6ac2ed9b9c3c15e6fe12cb54a361d94ee388ae36 Mon Sep 17 00:00:00 2001 From: Kevin Schildhorn Date: Wed, 20 Nov 2024 13:33:43 -0500 Subject: [PATCH] Adding documentation --- .../src/appleMain/kotlin/co/touchlab/kermit/OSLogWriter.kt | 7 ++++++- website/docs/IOS_LOGGING.md | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/kermit-core/src/appleMain/kotlin/co/touchlab/kermit/OSLogWriter.kt b/kermit-core/src/appleMain/kotlin/co/touchlab/kermit/OSLogWriter.kt index 853f53c1..90538f87 100644 --- a/kermit-core/src/appleMain/kotlin/co/touchlab/kermit/OSLogWriter.kt +++ b/kermit-core/src/appleMain/kotlin/co/touchlab/kermit/OSLogWriter.kt @@ -21,7 +21,12 @@ import platform.darwin.os_log_type_t import kotlin.experimental.ExperimentalNativeApi /** - * Write log statements to darwin oslog. + * Write log statements to darwin OSLog. + * + * Takes in three optional parameters specific to OSLog calls: + * subsystem - An identifier string that's passed directly into the OSLog constructor. (See documentation https://developer.apple.com/documentation/os/oslog/2320726-init) + * category - A category within the subsystem that's passed directly into the OSLog constructor. (See documentation https://developer.apple.com/documentation/os/oslog/2320726-init) + * publicLogging - When true OSLog enforces logs to be public (See documentation https://developer.apple.com/documentation/os/logging/generating_log_messages_from_your_code#3665948) */ open class OSLogWriter internal constructor( private val messageStringFormatter: MessageStringFormatter, diff --git a/website/docs/IOS_LOGGING.md b/website/docs/IOS_LOGGING.md index 57d3f383..1ff8fcc1 100644 --- a/website/docs/IOS_LOGGING.md +++ b/website/docs/IOS_LOGGING.md @@ -21,7 +21,12 @@ This is the default `LogWriter`. It is designed for local development. Each seve ## OSLogWriter -This is the parent class of `XcodeSeverityWriter`. There is no emoji added for severity, and `Throwable` is sent as a string to oslog. This may trim exceptions. You can implement a custom version that writes each line of a stack trace to oslog, or whatever else you'd like to do. Override `logThrowable`. +This is the parent class of `XcodeSeverityWriter`. There is no emoji added for severity, and `Throwable` is sent as a string to OSLog. This may trim exceptions. You can implement a custom version that writes each line of a stack trace to OSLog, or whatever else you'd like to do. Override `logThrowable`. + +In addition to the `MessageStringFormatter`, `OSLogWriter` takes in three optional parameters specific to OSLog calls: +* `subsystem` - An identifier string that's passed directly into the OSLog constructor. (See more [here](https://developer.apple.com/documentation/os/oslog/2320726-init)). +* `category` - A category within the subsystem that's passed directly into the OSLog constructor. (See more [here](https://developer.apple.com/documentation/os/oslog/2320726-init)). +* `publicLogging` - When true `OSLog` enforces logs to be public (See documentation [here](https://developer.apple.com/documentation/os/logging/generating_log_messages_from_your_code#3665948)). ## NSLogWriter