diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt index ac51e1dca0..de73e04f12 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt @@ -57,6 +57,7 @@ import org.matrix.android.sdk.api.session.room.model.RoomHistoryVisibilityConten import org.matrix.android.sdk.api.session.room.model.RoomMemberContent import org.matrix.android.sdk.api.util.JsonDict import org.matrix.android.sdk.internal.OlmMachine +import org.matrix.android.sdk.internal.setRustLogger import org.matrix.android.sdk.internal.crypto.actions.MegolmSessionDataImporter import org.matrix.android.sdk.internal.crypto.actions.SetDeviceVerificationAction import org.matrix.android.sdk.internal.crypto.algorithms.IMXEncrypting @@ -375,6 +376,7 @@ internal class DefaultCryptoService @Inject constructor( Timber.v("HELLLO WORLD STARTING CRYPTO") try { + setRustLogger() olmMachine = OlmMachine(userId, deviceId!!, dataDir) Timber.v("HELLLO WORLD STARTING $dataDir CRYPTO ${olmMachine?.identityKeys()}") diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/newCrypto.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/newCrypto.kt index 22da46ee33..20bde0ca1d 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/newCrypto.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/newCrypto.kt @@ -24,6 +24,20 @@ import uniffi.olm.OlmMachine as InnerMachine import uniffi.olm.Request import uniffi.olm.RequestType import uniffi.olm.Sas as InnerSas +import uniffi.olm.Logger +import uniffi.olm.setLogger + +import timber.log.Timber + +class CryptoLogger(): Logger { + override fun log(logLine: String) { + Timber.d(logLine) + } +} + +fun setRustLogger() { + setLogger(CryptoLogger() as Logger) +} class Device(inner: InnerDevice, machine: InnerMachine) { private val machine: InnerMachine = machine