mirror of
https://github.com/element-hq/element-android
synced 2024-12-20 08:22:00 +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.session.room.model.RoomMemberContent
|
||||||
import org.matrix.android.sdk.api.util.JsonDict
|
import org.matrix.android.sdk.api.util.JsonDict
|
||||||
import org.matrix.android.sdk.internal.OlmMachine
|
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.MegolmSessionDataImporter
|
||||||
import org.matrix.android.sdk.internal.crypto.actions.SetDeviceVerificationAction
|
import org.matrix.android.sdk.internal.crypto.actions.SetDeviceVerificationAction
|
||||||
import org.matrix.android.sdk.internal.crypto.algorithms.IMXEncrypting
|
import org.matrix.android.sdk.internal.crypto.algorithms.IMXEncrypting
|
||||||
|
@ -375,6 +376,7 @@ internal class DefaultCryptoService @Inject constructor(
|
||||||
Timber.v("HELLLO WORLD STARTING CRYPTO")
|
Timber.v("HELLLO WORLD STARTING CRYPTO")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
setRustLogger()
|
||||||
olmMachine = OlmMachine(userId, deviceId!!, dataDir)
|
olmMachine = OlmMachine(userId, deviceId!!, dataDir)
|
||||||
|
|
||||||
Timber.v("HELLLO WORLD STARTING $dataDir CRYPTO ${olmMachine?.identityKeys()}")
|
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.Request
|
||||||
import uniffi.olm.RequestType
|
import uniffi.olm.RequestType
|
||||||
import uniffi.olm.Sas as InnerSas
|
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) {
|
class Device(inner: InnerDevice, machine: InnerMachine) {
|
||||||
private val machine: InnerMachine = machine
|
private val machine: InnerMachine = machine
|
||||||
|
|
Loading…
Reference in a new issue