matrix-org / matrix-js-sdk

Matrix Client-Server SDK for JavaScript
Apache License 2.0
1.49k stars 578 forks source link

Add option for MatrixClient.initRustCrypto() to disable tracing #4177

Open xiaoyue opened 2 months ago

xiaoyue commented 2 months ago

The tracing option is by default turned on in the initRustCrypto function (rust-crypto module). This results in excessive logging information with no control over the logging levels.

new RustSdkCryptoJs.Tracing(RustSdkCryptoJs.LoggerLevel.Debug).turnOn(); // Line 94 in src/rust-crypto/index.ts

When MatrixClient.initRustCrypto() calls it, it does not have options to disable tracing or adjust its logging level. In the Rust SDK, this tracing/logging level can be set with an environment variable. In matrix-js-sdk, however, it seems to be hard-coded.

Can we either use a similar environment variable, or have it as an optional parameter in the init function?