Skip to content

Commit

Permalink
updating throwable calls
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Nov 15, 2024
1 parent 20d2f1d commit 8cc7e05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ open class OSLogWriter internal constructor(
}
}

@OptIn(ExperimentalNativeApi::class)
open fun logThrowable(osLogSeverity: os_log_type_t, throwable: Throwable) {
darwinLogger.log(osLogSeverity, throwable.getStackTrace().joinToString("\n"))
darwinLogger.log(osLogSeverity, throwable.stackTraceToString())
}

private fun kermitSeverityToOsLogType(severity: Severity): os_log_type_t = when (severity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ open class XcodeSeverityWriter(private val messageStringFormatter: MessageString
override fun formatMessage(severity: Severity, tag: Tag, message: Message): String =
"${emojiPrefix(severity)} ${messageStringFormatter.formatMessage(null, tag, message)}"

@OptIn(ExperimentalNativeApi::class)
override fun logThrowable(osLogSeverity: os_log_type_t, throwable: Throwable) {
// oslog cuts off longer strings, so for local development, println is more useful
println(throwable.getStackTrace().joinToString("\n"))
println(throwable.stackTraceToString())
}

//If this looks familiar, yes, it came directly from Napier :) https://github.com/AAkira/Napier#darwinios-macos-watchos-tvosintelapple-silicon
Expand Down

0 comments on commit 8cc7e05

Please sign in to comment.