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:
+12
-2
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user