feat: add throwable support to Log.d/i and inline lambda overloads

- Add optional throwable parameter to d() and i() across all platforms
- Add inline lambda overloads for all log levels to defer message
  construction, avoiding string allocation when level is filtered
- Restore VoiceMessagePreview to pass throwable directly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
davotoula
2026-03-28 11:19:06 +01:00
parent 250d89ca0a
commit 541b197a64
6 changed files with 71 additions and 9 deletions
@@ -48,14 +48,24 @@ actual object PlatformLog {
actual fun d(
tag: String,
message: String,
throwable: Throwable?,
) {
android.util.Log.d(tag, message)
if (throwable != null) {
android.util.Log.d(tag, message, throwable)
} else {
android.util.Log.d(tag, message)
}
}
actual fun i(
tag: String,
message: String,
throwable: Throwable?,
) {
android.util.Log.i(tag, message)
if (throwable != null) {
android.util.Log.i(tag, message, throwable)
} else {
android.util.Log.i(tag, message)
}
}
}