Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt consolidated logging mechanism #4370

Merged
merged 4 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changes to be released in next version
* Navigation: Start decoupling view controllers managed by MasterTabBarController (#3596 and #3618).
* Jitsi: Include optional server name field on JitsiJWTPayloadContextMatrix.
* CallPresenter: Add more logs for group calls.
* Logging: Adopted MXLog throughout the application (vector-im/element-ios/issues/4351).

🐛 Bugfix
* buildRelease.sh: Make bundler operations in the cloned repository folder.
Expand Down
2 changes: 1 addition & 1 deletion Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ - (void)addTimestampLabelForComponentIndex:(NSInteger)componentIndex
{
if (!self.bubbleInfoContainer)
{
NSLog(@"[MXKRoomBubbleTableViewCell+Riot] bubbleInfoContainer property is missing for cell class: %@", NSStringFromClass(self.class));
MXLogDebug(@"[MXKRoomBubbleTableViewCell+Riot] bubbleInfoContainer property is missing for cell class: %@", NSStringFromClass(self.class));
return;
}

Expand Down
8 changes: 4 additions & 4 deletions Riot/Categories/MXRoom+Riot.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (void)setRoomTag:(NSString*)tag completion:(void (^)(void))completion

NSString* tagOrder = [self.mxSession tagOrderToBeAtIndex:0 from:NSNotFound withTag:tag];

NSLog(@"[MXRoom+Riot] Update the room %@ tag from %@ to %@ with tag order %@", self.roomId, oldTag, tag, tagOrder);
MXLogDebug(@"[MXRoom+Riot] Update the room %@ tag from %@ to %@ with tag order %@", self.roomId, oldTag, tag, tagOrder);

[self replaceTag:oldTag
byTag:tag
Expand All @@ -57,7 +57,7 @@ - (void)setRoomTag:(NSString*)tag completion:(void (^)(void))completion

} failure:^(NSError *error) {

NSLog(@"[MXRoom+Riot] Failed to update the tag %@ of room (%@)", tag, self.roomId);
MXLogDebug(@"[MXRoom+Riot] Failed to update the tag %@ of room (%@)", tag, self.roomId);
NSString *userId = self.mxSession.myUser.userId;

// Notify user
Expand Down Expand Up @@ -166,7 +166,7 @@ - (void)mute:(void (^)(void))completion
// Check whether there is no pending update for this room
if (self.notificationCenterDidUpdateObserver)
{
NSLog(@"[MXRoom+Riot] Request in progress: ignore push rule update");
MXLogDebug(@"[MXRoom+Riot] Request in progress: ignore push rule update");
if (completion)
{
completion();
Expand Down Expand Up @@ -244,7 +244,7 @@ - (void)mentionsOnly:(void (^)(void))completion
// Check whether there is no pending update for this room
if (self.notificationCenterDidUpdateObserver)
{
NSLog(@"[MXRoom+Riot] Request in progress: ignore push rule update");
MXLogDebug(@"[MXRoom+Riot] Request in progress: ignore push rule update");
if (completion)
{
completion();
Expand Down
5 changes: 3 additions & 2 deletions Riot/Categories/UNUserNotificationCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import Foundation
import UserNotifications
import MatrixSDK

@objc extension UNUserNotificationCenter {

Expand All @@ -24,7 +25,7 @@ import UserNotifications
// get identifiers of notifications whose category identifiers are "TO_BE_REMOVED"
let identifiersToBeRemoved = notifications.compactMap({ $0.request.content.categoryIdentifier == Constants.toBeRemovedNotificationCategoryIdentifier ? $0.request.identifier : nil })

NSLog("[UNUserNotificationCenter] removeUnwantedNotifications: Removing \(identifiersToBeRemoved.count) notifications.")
MXLog.debug("[UNUserNotificationCenter] removeUnwantedNotifications: Removing \(identifiersToBeRemoved.count) notifications.")
// remove the notifications with these id's
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiersToBeRemoved)
}
Expand Down Expand Up @@ -52,7 +53,7 @@ import UserNotifications
// get identifiers of notifications that should be removed
let identifiersToBeRemoved = notifications.compactMap({ notificationShouldBeRemoved($0) ? $0.request.identifier : nil })

NSLog("[UNUserNotificationCenter] removeCallNotifications: Removing \(identifiersToBeRemoved.count) notifications.")
MXLog.debug("[UNUserNotificationCenter] removeCallNotifications: Removing \(identifiersToBeRemoved.count) notifications.")
// remove the notifications with these id's
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiersToBeRemoved)
}
Expand Down
2 changes: 1 addition & 1 deletion Riot/Managers/Analytics/Analytics.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (void)start
}
else
{
NSLog(@"[AppDelegate] The user decided to not send analytics");
MXLogDebug(@"[AppDelegate] The user decided to not send analytics");
matomoTracker.isOptedOut = YES;
[MXLogger logCrashes:NO];
}
Expand Down
2 changes: 1 addition & 1 deletion Riot/Managers/Analytics/DecryptionFailureTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ - (void)checkFailures
failuresCounts[failure.reason] = @(failuresCounts[failure.reason].unsignedIntegerValue + 1);
}

NSLog(@"[DecryptionFailureTracker] trackFailures: %@", failuresCounts);
MXLogDebug(@"[DecryptionFailureTracker] trackFailures: %@", failuresCounts);

for (NSString *reason in failuresCounts)
{
Expand Down
4 changes: 2 additions & 2 deletions Riot/Managers/BugReport/RageShakeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ - (void)startShaking:(UIResponder*)responder {
&& RiotSettings.shared.enableRageShake
&& !confirmationAlert)
{
NSLog(@"[RageShakeManager] Start shaking with [%@]", [responder class]);
MXLogDebug(@"[RageShakeManager] Start shaking with [%@]", [responder class]);

startShakingTimeStamp = [[NSDate date] timeIntervalSince1970];
isShaking = YES;
Expand All @@ -124,7 +124,7 @@ - (void)startShaking:(UIResponder*)responder {

- (void)stopShaking:(UIResponder*)responder
{
NSLog(@"[RageShakeManager] Stop shaking with [%@]", [responder class]);
MXLogDebug(@"[RageShakeManager] Stop shaking with [%@]", [responder class]);

if (isShaking && [AppDelegate theDelegate].isAppForeground && !confirmationAlert
&& (([[NSDate date] timeIntervalSince1970] - startShakingTimeStamp) > RAGESHAKEMANAGER_MINIMUM_SHAKING_DURATION))
Expand Down
Loading