From aabae58c9ea876d65b43dc64827f0ee89af1d151 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 26 Aug 2025 16:21:10 +0100 Subject: [PATCH] Tidy up some logs that have a prefix. (#4443) We haven't needed these for ages, Rust adds them to the log lines. --- .../Sources/Application/AppCoordinator.swift | 4 ++-- ElementX/Sources/Other/Pills/MessageText.swift | 2 +- .../Pills/PillAttachmentViewProvider.swift | 4 ++-- .../SoftLogoutScreenCoordinator.swift | 2 +- .../CallScreen/CallScreenViewModel.swift | 2 +- .../Manager/NotificationManager.swift | 18 +++++++++--------- .../Services/Room/JoinedRoomProxy.swift | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 54bcc3862..78d1f920e 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -336,7 +336,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg } func notificationTapped(content: UNNotificationContent) async { - MXLog.info("[AppCoordinator] tappedNotification") + MXLog.info("Tapped Notification") guard let roomID = content.roomID, content.receiverID != nil else { @@ -355,7 +355,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg } func handleInlineReply(_ service: NotificationManagerProtocol, content: UNNotificationContent, replyText: String) async { - MXLog.info("[AppCoordinator] handle notification reply") + MXLog.info("Handle notification reply") guard let roomID = content.roomID else { return diff --git a/ElementX/Sources/Other/Pills/MessageText.swift b/ElementX/Sources/Other/Pills/MessageText.swift index d91fceb52..07c00f8d6 100644 --- a/ElementX/Sources/Other/Pills/MessageText.swift +++ b/ElementX/Sources/Other/Pills/MessageText.swift @@ -63,7 +63,7 @@ struct MessageText: UIViewRepresentable { do { attributedString = try AttributedString(textView.attributedText, including: \.elementX) } catch { - MXLog.error("[MessageText] Failed to update attributedString: \(error)]") + MXLog.error("Failed to update attributedString: \(error)]") return } } diff --git a/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift b/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift index 662076bd3..7ccf401c4 100644 --- a/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift +++ b/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift @@ -37,7 +37,7 @@ final class PillAttachmentViewProvider: NSTextAttachmentViewProvider, NSSecureCo guard let textAttachment = textAttachment as? PillTextAttachment, let pillData = textAttachment.pillData else { - MXLog.failure("[PillAttachmentViewProvider]: attachment is missing data or not of expected class") + MXLog.failure("Attachment is missing data or not of expected class") return } @@ -51,7 +51,7 @@ final class PillAttachmentViewProvider: NSTextAttachmentViewProvider, NSSecureCo context = PillContext(timelineContext: timelineContext, data: pillData) mediaProvider = timelineContext.mediaProvider } else { - MXLog.failure("[PillAttachmentViewProvider]: missing room context") + MXLog.failure("Missing room context") return } diff --git a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift index be187cf84..9fccb0d0a 100644 --- a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift @@ -61,7 +61,7 @@ final class SoftLogoutScreenCoordinator: CoordinatorProtocol { viewModel.actions .sink { [weak self] action in guard let self else { return } - MXLog.info("[SoftLogoutCoordinator] SoftLogoutViewModel did complete with result: \(action).") + MXLog.info("Did complete with result: \(action).") switch action { case .login(let password): diff --git a/ElementX/Sources/Screens/CallScreen/CallScreenViewModel.swift b/ElementX/Sources/Screens/CallScreen/CallScreenViewModel.swift index 35877dbcc..aa7d45908 100644 --- a/ElementX/Sources/Screens/CallScreen/CallScreenViewModel.swift +++ b/ElementX/Sources/Screens/CallScreen/CallScreenViewModel.swift @@ -226,7 +226,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol private func handleOutputDeviceSelected(deviceID: String) { let isEarpiece = deviceID == Self.earpieceID - MXLog.info("[handleOutputDeviceSelected] is earpiece: \(isEarpiece)") + MXLog.info("Is earpiece: \(isEarpiece)") UIDevice.current.isProximityMonitoringEnabled = isEarpiece } diff --git a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift index ee9086ff0..cf8316a76 100644 --- a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift +++ b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift @@ -47,7 +47,7 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { notificationCenter.delegate = self notificationsEnabled = appSettings.enableNotifications - MXLog.info("[NotificationManager] app setting 'enableNotifications' is '\(notificationsEnabled)'") + MXLog.info("App setting 'enableNotifications' is '\(notificationsEnabled)'") // Listen for changes to AppSettings.enableNotifications appSettings.$enableNotifications @@ -62,14 +62,14 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { Task { do { let permissionGranted = try await notificationCenter.requestAuthorization(options: [.alert, .sound, .badge]) - MXLog.info("[NotificationManager] permission granted: \(permissionGranted)") + MXLog.info("Permission granted: \(permissionGranted)") await MainActor.run { if permissionGranted { self.delegate?.registerForRemoteNotifications() } } } catch { - MXLog.error("[NotificationManager] request authorization failed: \(error)") + MXLog.error("Request authorization failed: \(error)") } } } @@ -101,7 +101,7 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { } func registrationFailed(with error: Error) { - MXLog.error("[NotificationManager] device token registration failed with error: \(error)") + MXLog.error("Device token registration failed with error: \(error)") } func showLocalNotification(with title: String, subtitle: String?) async { @@ -115,9 +115,9 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { trigger: nil) do { try await notificationCenter.add(request) - MXLog.info("[NotificationManager] show local notification succeeded") + MXLog.info("Show local notification succeeded") } catch { - MXLog.error("[NotificationManager] show local notification failed: \(error)") + MXLog.error("Show local notification failed: \(error)") } } @@ -168,10 +168,10 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { profileTag: pusherProfileTag(), lang: Bundle.app.preferredLocalizations.first ?? "en") try await clientProxy.setPusher(with: configuration) - MXLog.info("[NotificationManager] set pusher succeeded") + MXLog.info("Set pusher succeeded") return true } catch { - MXLog.error("[NotificationManager] set pusher failed: \(error)") + MXLog.error("Set pusher failed: \(error)") return false } } @@ -193,7 +193,7 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { private func enableNotifications(_ enable: Bool) { guard notificationsEnabled != enable else { return } notificationsEnabled = enable - MXLog.info("[NotificationManager] app setting 'enableNotifications' changed to '\(enable)'") + MXLog.info("App setting 'enableNotifications' changed to '\(enable)'") if enable { requestAuthorization() } else { diff --git a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift index d82ad6aa8..a13d26ac1 100644 --- a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift +++ b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift @@ -313,7 +313,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { membersSubject.value = members.map(RoomMemberProxy.init) } } catch { - MXLog.error("[RoomProxy] Failed updating members using no sync API: \(error)") + MXLog.error("Failed updating members using no sync API: \(error)") } do { @@ -323,7 +323,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { membersSubject.value = members.map(RoomMemberProxy.init) } } catch { - MXLog.error("[RoomProxy] Failed updating members using sync API: \(error)") + MXLog.error("Failed updating members using sync API: \(error)") } }