Expose the log level in developer settings

This commit is contained in:
Stefan Ceriu
2023-08-23 14:58:44 +03:00
committed by Stefan Ceriu
parent beeb5fc83c
commit a19f5a4186
9 changed files with 44 additions and 39 deletions
@@ -57,11 +57,16 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
@Consumable private var storedAppRoute: AppRoute?
init() {
MXLog.configure()
let appSettings = AppSettings()
MXLog.configure(logLevel: appSettings.logLevel)
if ProcessInfo.processInfo.environment["RESET_APP_SETTINGS"].map(Bool.init) == true {
AppSettings.reset()
}
navigationRootCoordinator = NavigationRootCoordinator()
Self.setupServiceLocator(navigationRootCoordinator: navigationRootCoordinator)
Self.setupServiceLocator(navigationRootCoordinator: navigationRootCoordinator, appSettings: appSettings)
ServiceLocator.shared.analytics.startIfEnabled()
@@ -191,13 +196,9 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
// MARK: - Private
private static func setupServiceLocator(navigationRootCoordinator: NavigationRootCoordinator) {
if ProcessInfo.processInfo.environment["RESET_APP_SETTINGS"].map(Bool.init) == true {
AppSettings.reset()
}
private static func setupServiceLocator(navigationRootCoordinator: NavigationRootCoordinator, appSettings: AppSettings) {
ServiceLocator.shared.register(userIndicatorController: UserIndicatorController(rootCoordinator: navigationRootCoordinator))
ServiceLocator.shared.register(appSettings: AppSettings())
ServiceLocator.shared.register(appSettings: appSettings)
ServiceLocator.shared.register(networkMonitor: NetworkMonitor())
ServiceLocator.shared.register(bugReportService: BugReportService(withBaseURL: ServiceLocator.shared.settings.bugReportServiceBaseURL,
sentryURL: ServiceLocator.shared.settings.bugReportSentryURL,
@@ -29,6 +29,7 @@ final class AppSettings {
case enableNotifications
case enableInAppNotifications
case pusherProfileTag
case logLevel
// Feature flags
case shouldCollapseRoomStateEvents
@@ -196,6 +197,9 @@ final class AppSettings {
let permalinkBaseURL: URL = "https://matrix.to"
@UserPreference(key: UserDefaultsKeys.logLevel, defaultValue: TracingConfiguration.LogLevel.info, storageType: .userDefaults(store))
var logLevel
// MARK: - Maps
// maptiler base url