Enable Rust trace log packs (#4514)
* Enable Rust trace log packs This is a way to forcefully enable trace logs only for a few Rust crates in a safe way
This commit is contained in:
parent
b2791d5aad
commit
c3ff9c9bda
14 changed files with 131 additions and 4 deletions
|
|
@ -51,7 +51,6 @@ fun TracingConfiguration.map(): org.matrix.rustcomponents.sdk.TracingConfigurati
|
|||
writeToStdoutOrSystem = writesToLogcat,
|
||||
logLevel = logLevel.toRustLogLevel(),
|
||||
extraTargets = extraTargets,
|
||||
// WARNING: this should be used only to debug issues, changes to this value should *never* be published
|
||||
traceLogPacks = emptyList(),
|
||||
traceLogPacks = traceLogPacks.map(),
|
||||
writeToFiles = writesToFilesConfiguration.toTracingFileConfiguration(),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2025 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.impl.tracing
|
||||
|
||||
import io.element.android.libraries.matrix.api.tracing.TraceLogPack
|
||||
import org.matrix.rustcomponents.sdk.TraceLogPacks as RustTraceLogPack
|
||||
|
||||
fun TraceLogPack.map(): RustTraceLogPack = when (this) {
|
||||
TraceLogPack.SEND_QUEUE -> RustTraceLogPack.SEND_QUEUE
|
||||
TraceLogPack.EVENT_CACHE -> RustTraceLogPack.EVENT_CACHE
|
||||
TraceLogPack.TIMELINE -> RustTraceLogPack.TIMELINE
|
||||
}
|
||||
|
||||
fun Collection<TraceLogPack>.map(): List<RustTraceLogPack> {
|
||||
return map { it.map() }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue