From 33a53a297156150b6de9ccab20b2c4cea8938c82 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 25 Aug 2023 12:13:17 +0300 Subject: [PATCH] Logging tweaks: keep default log levels for common and hyper no matter what the feature flag says --- ElementX/Sources/Other/Logging/RustTracing.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ElementX/Sources/Other/Logging/RustTracing.swift b/ElementX/Sources/Other/Logging/RustTracing.swift index e7f7edba5..0e65e80e0 100644 --- a/ElementX/Sources/Other/Logging/RustTracing.swift +++ b/ElementX/Sources/Other/Logging/RustTracing.swift @@ -39,6 +39,11 @@ struct TracingConfiguration { /// - Returns: a custom tracing configuration static func custom(logLevel: LogLevel) -> TracingConfiguration { let overrides = targets.keys.reduce(into: [Target: LogLevel]()) { partialResult, target in + // Keep the defaults here + if target == .common || target == .hyper { + return + } + partialResult[target] = logLevel } @@ -50,6 +55,8 @@ struct TracingConfiguration { enum Target: String { case common = "" + case elementx + case hyper, matrix_sdk_ffi, matrix_sdk_crypto case matrix_sdk_http_client = "matrix_sdk::http_client" @@ -61,7 +68,8 @@ struct TracingConfiguration { static let targets: OrderedDictionary = [ .common: .info, - .hyper: .info, + .elementx: .info, + .hyper: .warn, .matrix_sdk_crypto: .info, .matrix_sdk_http_client: .info, .matrix_sdk_sliding_sync: .info,