mirror of
https://github.com/element-hq/element-android
synced 2024-12-20 00:13:12 +03:00
crypto: Connect the rust logger to timber
This commit is contained in:
parent
4589b882c0
commit
d50df9537c
2 changed files with 16 additions and 0 deletions
|
@ -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()}")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue