Allow setting custom log levels (#1592)

* Allow using custom tracing configuration from the developer options screen. Clean up RustTracing
* Move log level configurations to a separate view
* Disable autocorrection
* Fix unit tests
* Use TracingConfiguration.info as the default text value, switch to a TextEditor
This commit is contained in:
Stefan Ceriu
2023-08-30 15:35:49 +03:00
committed by GitHub
parent 3c3e31f9e4
commit 3258d3a85d
4 changed files with 109 additions and 44 deletions
@@ -20,17 +20,13 @@ import XCTest
class TracingConfigurationTests: XCTestCase {
func testConfiguration() {
let configuration = TracingConfiguration(overrides: [.common: .trace,
.matrix_sdk_base_sliding_sync: .error,
.matrix_sdk_http_client: .warn,
.matrix_sdk_crypto: .info,
.hyper: .debug])
let configuration = TracingConfiguration(logLevel: .trace)
let filterComponents = configuration.filter.components(separatedBy: ",")
XCTAssertEqual(filterComponents.first, "trace")
XCTAssertTrue(filterComponents.contains("matrix_sdk_base::sliding_sync=error"))
XCTAssertTrue(filterComponents.contains("matrix_sdk::http_client=warn"))
XCTAssertTrue(filterComponents.contains("matrix_sdk_crypto=info"))
XCTAssertTrue(filterComponents.contains("hyper=debug"))
XCTAssertEqual(filterComponents.first, "info")
XCTAssertTrue(filterComponents.contains("matrix_sdk_base::sliding_sync=trace"))
XCTAssertTrue(filterComponents.contains("matrix_sdk::http_client=trace"))
XCTAssertTrue(filterComponents.contains("matrix_sdk_crypto=trace"))
XCTAssertTrue(filterComponents.contains("hyper=warn"))
}
}