mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Feature flag to OTLP tracing
This commit is contained in:
committed by
Stefan Ceriu
parent
63d90eeb3e
commit
ecc549b280
@@ -58,7 +58,14 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
|
||||
|
||||
init() {
|
||||
let appSettings = AppSettings()
|
||||
MXLog.configure(logLevel: appSettings.logLevel)
|
||||
|
||||
if appSettings.otlpTracingEnabled {
|
||||
MXLog.configure(logLevel: appSettings.logLevel, otlpConfiguration: .init(url: appSettings.otlpTracingURL,
|
||||
username: appSettings.otlpTracingUsername,
|
||||
password: appSettings.otlpTracingPassword))
|
||||
} else {
|
||||
MXLog.configure(logLevel: appSettings.logLevel)
|
||||
}
|
||||
|
||||
if ProcessInfo.processInfo.environment["RESET_APP_SETTINGS"].map(Bool.init) == true {
|
||||
AppSettings.reset()
|
||||
|
||||
@@ -30,6 +30,7 @@ final class AppSettings {
|
||||
case enableInAppNotifications
|
||||
case pusherProfileTag
|
||||
case logLevel
|
||||
case otlpTracingEnabled
|
||||
|
||||
// Feature flags
|
||||
case shouldCollapseRoomStateEvents
|
||||
@@ -197,9 +198,18 @@ final class AppSettings {
|
||||
|
||||
let permalinkBaseURL: URL = "https://matrix.to"
|
||||
|
||||
// MARK: - Logging
|
||||
|
||||
@UserPreference(key: UserDefaultsKeys.logLevel, defaultValue: TracingConfiguration.LogLevel.info, storageType: .userDefaults(store))
|
||||
var logLevel
|
||||
|
||||
@UserPreference(key: UserDefaultsKeys.otlpTracingEnabled, defaultValue: false, storageType: .userDefaults(store))
|
||||
var otlpTracingEnabled
|
||||
|
||||
let otlpTracingURL = InfoPlistReader.main.otlpTracingURL
|
||||
let otlpTracingUsername = InfoPlistReader.main.otlpTracingUsername
|
||||
let otlpTracingPassword = InfoPlistReader.main.otlpTracingPassword
|
||||
|
||||
// MARK: - Maps
|
||||
|
||||
// maptiler base url
|
||||
|
||||
Reference in New Issue
Block a user