Fix tracing configuration in debug and nightlies (#3019)
* Fix tracing configuration in debug and nightlies: - Debug will now write the logs to disk too. - Nightly will be able to customise tracing filters. - Improved the configure tracing and bug report screens. * Update screenshots * Add changelog --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
3e04870abb
commit
55a1ac4bb5
9 changed files with 101 additions and 36 deletions
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package io.element.android.features.preferences.impl.developer.tracing
|
||||
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
|
|
@ -48,6 +49,7 @@ import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
|||
import io.element.android.libraries.designsystem.theme.aliasScreenTitle
|
||||
import io.element.android.libraries.designsystem.theme.components.DropdownMenu
|
||||
import io.element.android.libraries.designsystem.theme.components.DropdownMenuItem
|
||||
import io.element.android.libraries.designsystem.theme.components.HorizontalDivider
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.IconButton
|
||||
import io.element.android.libraries.designsystem.theme.components.ListItem
|
||||
|
|
@ -124,15 +126,17 @@ fun ConfigureTracingView(
|
|||
.consumeWindowInsets(it)
|
||||
.verticalScroll(state = rememberScrollState())
|
||||
) {
|
||||
CrateListContent(state)
|
||||
ListItem(
|
||||
headlineContent = {
|
||||
Text(
|
||||
text = "Kill and restart the app for the change to take effect.",
|
||||
modifier = Modifier.clickable { Runtime.getRuntime().exit(0) },
|
||||
text = "Tap here to kill the app and apply the changes. You'll have to re-open the app manually.",
|
||||
style = ElementTheme.typography.fontHeadingSmMedium,
|
||||
)
|
||||
},
|
||||
)
|
||||
HorizontalDivider()
|
||||
CrateListContent(state)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,14 +18,13 @@ package io.element.android.features.preferences.impl.developer.tracing
|
|||
|
||||
import io.element.android.libraries.matrix.api.tracing.LogLevel
|
||||
import io.element.android.libraries.matrix.api.tracing.Target
|
||||
import io.element.android.libraries.matrix.api.tracing.TracingFilterConfigurations
|
||||
import io.element.android.libraries.matrix.api.tracing.TracingFilterConfiguration
|
||||
import javax.inject.Inject
|
||||
|
||||
class TargetLogLevelMapBuilder @Inject constructor(
|
||||
private val tracingConfigurationStore: TracingConfigurationStore,
|
||||
private val defaultConfig: TracingFilterConfiguration,
|
||||
) {
|
||||
private val defaultConfig = TracingFilterConfigurations.debug
|
||||
|
||||
fun getDefaultMap(): Map<Target, LogLevel> {
|
||||
return Target.entries.associateWith { target ->
|
||||
defaultConfig.getLogLevel(target)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import app.cash.turbine.test
|
|||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.libraries.matrix.api.tracing.LogLevel
|
||||
import io.element.android.libraries.matrix.api.tracing.Target
|
||||
import io.element.android.libraries.matrix.api.tracing.TracingFilterConfigurations
|
||||
import io.element.android.tests.testutils.WarmUpRule
|
||||
import io.element.android.tests.testutils.waitForPredicate
|
||||
import kotlinx.coroutines.test.runTest
|
||||
|
|
@ -37,7 +38,7 @@ class ConfigureTracingPresenterTest {
|
|||
val store = InMemoryTracingConfigurationStore()
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -54,7 +55,7 @@ class ConfigureTracingPresenterTest {
|
|||
store.givenLogLevel(LogLevel.ERROR)
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -70,7 +71,7 @@ class ConfigureTracingPresenterTest {
|
|||
val store = InMemoryTracingConfigurationStore()
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -89,7 +90,7 @@ class ConfigureTracingPresenterTest {
|
|||
val store = InMemoryTracingConfigurationStore()
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue