quick log improvents

This commit is contained in:
Valere 2021-11-30 16:52:11 +01:00
parent 8bb2f0584e
commit 2e71f38f00
2 changed files with 7 additions and 1 deletions

View file

@ -90,6 +90,7 @@ import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject
import kotlin.math.max
import kotlin.system.measureTimeMillis
/**
* A `CryptoService` class instance manages the end-to-end crypto for a session.
@ -542,7 +543,11 @@ internal class DefaultCryptoService @Inject constructor(
val t0 = System.currentTimeMillis()
Timber.tag(loggerTag.value).v("encryptEventContent() starts")
runCatching {
measureTimeMillis {
preshareRoomKey(roomId, userIds)
}.also {
Timber.d("Shared room key in room $roomId took $it ms")
}
val content = encrypt(roomId, eventType, eventContent)
Timber.tag(loggerTag.value).v("## CRYPTO | encryptEventContent() : succeeds after ${System.currentTimeMillis() - t0} ms")
MXEncryptEventContentResult(content, EventType.ENCRYPTED)

View file

@ -60,6 +60,7 @@ internal class DefaultSendEventTask @Inject constructor(
eventType = event.type ?: ""
)
}
Timber.d("Event sent to ${event.roomId} with event id ${response.eventId}")
localEchoRepository.updateSendState(localId, params.event.roomId, SendState.SENT)
return response.eventId.also {
Timber.d("Event: $it just sent in ${params.event.roomId}")