Various logging fixes (#164)

Various logging fixes:
* imported the ObjCWrapper and updated the MXLogger. Also added back support for app containers
* updated MXLog.swift from El and fixed/improved its logging format
* updated most app log strings
* Remove unnecessary swiftlint rule
* Various tweaks following code review
* Added back type annoation on MXLogger logFiles method
* Fix generated Swift-ObjC header name
This commit is contained in:
Stefan Ceriu
2022-08-30 18:05:21 +03:00
committed by GitHub
parent c92e6c2092
commit 39be67cec6
24 changed files with 288 additions and 102 deletions
@@ -95,7 +95,7 @@ class AuthenticationCoordinator: Coordinator, Presentable {
case .updated:
self.showLoginScreen()
case .dismiss:
MXLog.failure("[AuthenticationCoordinator] ServerSelectionScreen is requesting dismiss when part of a stack.")
MXLog.failure("ServerSelectionScreen is requesting dismiss when part of a stack.")
}
}
@@ -76,11 +76,11 @@ final class LoginCoordinator: Coordinator, Presentable {
// MARK: - Public
func start() {
MXLog.debug("[LoginCoordinator] did start.")
MXLog.debug("Did start.")
loginViewModel.callback = { [weak self] action in
guard let self = self else { return }
MXLog.debug("[LoginCoordinator] LoginViewModel did callback with result: \(action).")
MXLog.debug("LoginViewModel did callback with result: \(action).")
switch action {
case .selectServer:
@@ -204,7 +204,7 @@ final class LoginCoordinator: Coordinator, Presentable {
/// Presents the server selection screen as a modal.
private func presentServerSelectionScreen() {
MXLog.debug("[LoginCoordinator] presentServerSelectionScreen")
MXLog.debug("PresentServerSelectionScreen")
let parameters = ServerSelectionCoordinatorParameters(authenticationService: authenticationService,
hasModalPresentation: true)
let coordinator = ServerSelectionCoordinator(parameters: parameters)
@@ -64,11 +64,11 @@ final class ServerSelectionCoordinator: Coordinator, Presentable {
// MARK: - Public
func start() {
MXLog.debug("[ServerSelectionCoordinator] did start.")
MXLog.debug("Did start.")
serverSelectionViewModel.callback = { [weak self] action in
guard let self = self else { return }
MXLog.debug("[ServerSelectionCoordinator] ServerSelectionViewModel did callback with action: \(action).")
MXLog.debug("ServerSelectionViewModel did callback with action: \(action).")
switch action {
case .confirm(let homeserverAddress):
@@ -57,10 +57,10 @@ final class BugReportCoordinator: Coordinator, Presentable {
// MARK: - Public
func start() {
MXLog.debug("[BugReportCoordinator] did start.")
MXLog.debug("Did start.")
bugReportViewModel.callback = { [weak self] result in
guard let self = self else { return }
MXLog.debug("[BugReportCoordinator] BugReportViewModel did complete with result: \(result).")
MXLog.debug("BugReportViewModel did complete with result: \(result).")
switch result {
case .submitStarted:
self.startLoading()
@@ -47,10 +47,10 @@ class BugReportViewModel: BugReportViewModelType, BugReportViewModelProtocol {
includeCrashLog: true,
githubLabels: BuildSettings.bugReportGHLabels,
files: files)
MXLog.info("[BugReportViewModel] submitBugReport succeeded, result: \(result.reportUrl)")
MXLog.info("SubmitBugReport succeeded, result: \(result.reportUrl)")
callback?(.submitFinished)
} catch {
MXLog.error("[BugReportViewModel] submitBugReport failed: \(error)")
MXLog.error("SubmitBugReport failed: \(error)")
callback?(.submitFailed(error: error))
}
}
@@ -49,7 +49,7 @@ final class SessionVerificationCoordinator: Coordinator, Presentable {
// MARK: - Public
func start() {
MXLog.debug("[SessionVerificationCoordinator] did start.")
MXLog.debug("Did start.")
sessionVerificationViewModel.callback = { [weak self] action in
guard let self = self else { return }
@@ -51,7 +51,7 @@ class SessionVerificationViewModel: SessionVerificationViewModelType, SessionVer
switch callback {
case .receivedVerificationData(let emojis):
guard self.stateMachine.state == .requestingVerification else {
MXLog.warning("[SessionVerificationViewModel] callbacks: Ignoring receivedVerificationData due to invalid state.")
MXLog.warning("Callbacks: Ignoring receivedVerificationData due to invalid state.")
return
}
@@ -58,7 +58,7 @@ final class SettingsCoordinator: Coordinator, Presentable {
settingsViewModel.callback = { [weak self] result in
guard let self = self else { return }
MXLog.debug("[SettingsCoordinator] SettingsViewModel did complete with result: \(result).")
MXLog.debug("SettingsViewModel did complete with result: \(result).")
switch result {
case .reportBug:
self.presentBugReportScreen()
@@ -47,9 +47,9 @@ final class SplashScreenCoordinator: Coordinator, Presentable {
// MARK: - Public
func start() {
MXLog.debug("[SplashScreenCoordinator] did start.")
MXLog.debug("Did start.")
splashScreenViewModel.callback = { [weak self] action in
MXLog.debug("[SplashScreenCoordinator] SplashScreenViewModel did complete with result: \(action).")
MXLog.debug("SplashScreenViewModel did complete with result: \(action).")
guard let self = self else { return }
switch action {
case .login: