mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Add developer options for Rust's Trace Log Packs. (#3929)
* Add support for configuring log packs. * Update call widget parameters. * Update the SDK.
This commit is contained in:
@@ -69,7 +69,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
|
||||
let appSettings = appHooks.appSettingsHook.configure(AppSettings())
|
||||
|
||||
Target.mainApp.configure(logLevel: appSettings.logLevel)
|
||||
Target.mainApp.configure(logLevel: appSettings.logLevel, traceLogPacks: appSettings.traceLogPacks)
|
||||
|
||||
let appName = InfoPlistReader.main.bundleDisplayName
|
||||
let appVersion = InfoPlistReader.main.bundleShortVersionString
|
||||
|
||||
@@ -11,6 +11,7 @@ import SwiftUI
|
||||
// Common settings between app and NSE
|
||||
protocol CommonSettingsProtocol {
|
||||
var logLevel: LogLevel { get }
|
||||
var traceLogPacks: Set<TraceLogPack> { get }
|
||||
var enableOnlySignedDeviceIsolationMode: Bool { get }
|
||||
var hideInviteAvatars: Bool { get }
|
||||
var hideTimelineMedia: Bool { get }
|
||||
@@ -36,6 +37,7 @@ final class AppSettings {
|
||||
case enableInAppNotifications
|
||||
case pusherProfileTag
|
||||
case logLevel
|
||||
case traceLogPacks
|
||||
case viewSourceEnabled
|
||||
case optimizeMediaUploads
|
||||
case appAppearance
|
||||
@@ -306,6 +308,9 @@ final class AppSettings {
|
||||
@UserPreference(key: UserDefaultsKeys.logLevel, defaultValue: LogLevel.info, storageType: .userDefaults(store))
|
||||
var logLevel
|
||||
|
||||
@UserPreference(key: UserDefaultsKeys.traceLogPacks, defaultValue: [], storageType: .userDefaults(store))
|
||||
var traceLogPacks: Set<TraceLogPack>
|
||||
|
||||
/// Configuration to enable only signed device isolation mode for crypto. In this mode only devices signed by their owner will be considered in e2ee rooms.
|
||||
@UserPreference(key: UserDefaultsKeys.enableOnlySignedDeviceIsolationMode, defaultValue: false, storageType: .userDefaults(store))
|
||||
var enableOnlySignedDeviceIsolationMode
|
||||
|
||||
@@ -15,23 +15,35 @@ enum Target: String {
|
||||
|
||||
private static var isConfigured = false
|
||||
|
||||
func configure(logLevel: LogLevel) {
|
||||
func configure(logLevel: LogLevel, traceLogPacks: Set<TraceLogPack>) {
|
||||
guard !Self.isConfigured else {
|
||||
return
|
||||
}
|
||||
|
||||
switch self {
|
||||
case .mainApp:
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel, currentTarget: rawValue, filePrefix: nil)
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel,
|
||||
traceLogPacks: traceLogPacks,
|
||||
currentTarget: rawValue,
|
||||
filePrefix: nil)
|
||||
initPlatform(config: tracingConfiguration, useLightweightTokioRuntime: false)
|
||||
case .nse:
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel, currentTarget: rawValue, filePrefix: rawValue)
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel,
|
||||
traceLogPacks: traceLogPacks,
|
||||
currentTarget: rawValue,
|
||||
filePrefix: rawValue)
|
||||
initPlatform(config: tracingConfiguration, useLightweightTokioRuntime: true)
|
||||
case .shareExtension:
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel, currentTarget: rawValue, filePrefix: rawValue)
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel,
|
||||
traceLogPacks: traceLogPacks,
|
||||
currentTarget: rawValue,
|
||||
filePrefix: rawValue)
|
||||
initPlatform(config: tracingConfiguration, useLightweightTokioRuntime: true)
|
||||
case .tests:
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel, currentTarget: rawValue, filePrefix: rawValue)
|
||||
let tracingConfiguration = Tracing.buildConfiguration(logLevel: logLevel,
|
||||
traceLogPacks: traceLogPacks,
|
||||
currentTarget: rawValue,
|
||||
filePrefix: rawValue)
|
||||
initPlatform(config: tracingConfiguration, useLightweightTokioRuntime: false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user