Skip to content

Commit

Permalink
Adding documentation (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn authored Nov 26, 2024
1 parent c9af0b7 commit 1984071
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion website/docs/IOS_LOGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1984071

Please sign in to comment.