Skip to content

Commit

Permalink
Solved PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaafanador3 committed Jun 28, 2024
1 parent 7c94c77 commit 39bc5d6
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion Realm/ObjectServerTests/RLMSyncTestCase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ - (RLMApp *)appWithId:(NSString *)appId {
RLMApp *app = [RLMApp appWithConfiguration:config];
RLMSyncManager *syncManager = app.syncManager;
syncManager.userAgent = self.name;
[RLMLogger setLevel:RLMLogLevelWarn forCategory:RLMLogCategoryRealmSync];
[RLMLogger setLevel:RLMLogLevelWarn forCategory:RLMLogCategorySync];
return app;
}

Expand Down
28 changes: 14 additions & 14 deletions Realm/RLMLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,33 +74,33 @@ typedef NS_ENUM(NSUInteger, RLMLogCategory) {
/// Top level log category for Realm, updating this category level would set all other subcategories too.
RLMLogCategoryRealm,
/// Log category for all sdk related logs.
RLMLogCategoryRealmSDK,
RLMLogCategorySDK,
/// Log category for all app related logs.
RLMLogCategoryRealmApp,
RLMLogCategoryApp,
/// Log category for all database related logs.
RLMLogCategoryRealmStorage,
RLMLogCategoryStorage,
/// Log category for all database transaction related logs.
RLMLogCategoryRealmStorageTransaction,
RLMLogCategoryStorageTransaction,
/// Log category for all database queries related logs.
RLMLogCategoryRealmStorageQuery,
RLMLogCategoryStorageQuery,
/// Log category for all database object related logs.
RLMLogCategoryRealmStorageObject,
RLMLogCategoryStorageObject,
/// Log category for all database notification related logs.
RLMLogCategoryRealmStorageNotification,
RLMLogCategoryStorageNotification,
/// Log category for all sync related logs.
RLMLogCategoryRealmSync,
RLMLogCategorySync,
/// Log category for all sync client related logs.
RLMLogCategoryRealmSyncClient,
RLMLogCategorySyncClient,
/// Log category for all sync client session related logs.
RLMLogCategoryRealmSyncClientSession,
RLMLogCategorySyncClientSession,
/// Log category for all sync client changeset related logs.
RLMLogCategoryRealmSyncClientChangeset,
RLMLogCategorySyncClientChangeset,
/// Log category for all sync client network related logs.
RLMLogCategoryRealmSyncClientNetwork,
RLMLogCategorySyncClientNetwork,
/// Log category for all sync client reset related logs.
RLMLogCategoryRealmSyncClientReset,
RLMLogCategorySyncClientReset,
/// Log category for all sync server related logs.
RLMLogCategoryRealmSyncServer
RLMLogCategorySyncServer
};

/// A log callback function which can be set on RLMLogger.
Expand Down
56 changes: 28 additions & 28 deletions Realm/RLMLogger.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,41 +78,41 @@ static RLMLogLevel logLevelForLevel(Level logLevel) {
static LogCategory& categoryForLogCategory(RLMLogCategory logCategory) {
switch (logCategory) {
case RLMLogCategoryRealm: return LogCategory::realm;
case RLMLogCategoryRealmSDK: return LogCategory::sdk;
case RLMLogCategoryRealmApp: return LogCategory::app;
case RLMLogCategoryRealmStorage: return LogCategory::storage;
case RLMLogCategoryRealmStorageTransaction: return LogCategory::transaction;
case RLMLogCategoryRealmStorageQuery: return LogCategory::query;
case RLMLogCategoryRealmStorageObject: return LogCategory::object;
case RLMLogCategoryRealmStorageNotification: return LogCategory::notification;
case RLMLogCategoryRealmSync: return LogCategory::sync;
case RLMLogCategoryRealmSyncClient: return LogCategory::client;
case RLMLogCategoryRealmSyncClientSession: return LogCategory::session;
case RLMLogCategoryRealmSyncClientChangeset: return LogCategory::changeset;
case RLMLogCategoryRealmSyncClientNetwork: return LogCategory::network;
case RLMLogCategoryRealmSyncClientReset: return LogCategory::reset;
case RLMLogCategoryRealmSyncServer: return LogCategory::server;
case RLMLogCategorySDK: return LogCategory::sdk;
case RLMLogCategoryApp: return LogCategory::app;
case RLMLogCategoryStorage: return LogCategory::storage;
case RLMLogCategoryStorageTransaction: return LogCategory::transaction;
case RLMLogCategoryStorageQuery: return LogCategory::query;
case RLMLogCategoryStorageObject: return LogCategory::object;
case RLMLogCategoryStorageNotification: return LogCategory::notification;
case RLMLogCategorySync: return LogCategory::sync;
case RLMLogCategorySyncClient: return LogCategory::client;
case RLMLogCategorySyncClientSession: return LogCategory::session;
case RLMLogCategorySyncClientChangeset: return LogCategory::changeset;
case RLMLogCategorySyncClientNetwork: return LogCategory::network;
case RLMLogCategorySyncClientReset: return LogCategory::reset;
case RLMLogCategorySyncServer: return LogCategory::server;
};
REALM_UNREACHABLE();
}

static RLMLogCategory logCategoryForCategoryName(std::string category) {
NSDictionary *categories = @{
@"Realm": @(RLMLogCategoryRealm),
@"Realm.SDK": @(RLMLogCategoryRealmSDK),
@"Realm.App": @(RLMLogCategoryRealmApp),
@"Realm.Storage": @(RLMLogCategoryRealmStorage),
@"Realm.Storage.Transaction": @(RLMLogCategoryRealmStorageTransaction),
@"Realm.Storage.Query": @(RLMLogCategoryRealmStorageQuery),
@"Realm.Storage.Object": @(RLMLogCategoryRealmStorageObject),
@"Realm.Storage.Notification": @(RLMLogCategoryRealmStorageNotification),
@"Realm.Sync": @(RLMLogCategoryRealmSync),
@"Realm.Sync.Client": @(RLMLogCategoryRealmSyncClient),
@"Realm.Sync.Client.Session": @(RLMLogCategoryRealmSyncClientSession),
@"Realm.Sync.Client.Changeset": @(RLMLogCategoryRealmSyncClientChangeset),
@"Realm.Sync.Client.Network": @(RLMLogCategoryRealmSyncClientNetwork),
@"Realm.Sync.Client.Reset": @(RLMLogCategoryRealmSyncClientReset),
@"Realm.Sync.Server": @(RLMLogCategoryRealmSyncServer)
@"Realm.SDK": @(RLMLogCategorySDK),
@"Realm.App": @(RLMLogCategoryApp),
@"Realm.Storage": @(RLMLogCategoryStorage),
@"Realm.Storage.Transaction": @(RLMLogCategoryStorageTransaction),
@"Realm.Storage.Query": @(RLMLogCategoryStorageQuery),
@"Realm.Storage.Object": @(RLMLogCategoryStorageObject),
@"Realm.Storage.Notification": @(RLMLogCategoryStorageNotification),
@"Realm.Sync": @(RLMLogCategorySync),
@"Realm.Sync.Client": @(RLMLogCategorySyncClient),
@"Realm.Sync.Client.Session": @(RLMLogCategorySyncClientSession),
@"Realm.Sync.Client.Changeset": @(RLMLogCategorySyncClientChangeset),
@"Realm.Sync.Client.Network": @(RLMLogCategorySyncClientNetwork),
@"Realm.Sync.Client.Reset": @(RLMLogCategorySyncClientReset),
@"Realm.Sync.Server": @(RLMLogCategorySyncServer)
};
if (NSNumber *logCategory = [categories objectForKey:RLMStringDataToNSString(category)]) {
return RLMLogCategory([logCategory intValue]);
Expand Down
56 changes: 28 additions & 28 deletions RealmSwift/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,33 +257,33 @@ private extension ObjectiveCSupport {
case Category.realm:
return RLMLogCategory.realm
case Category.sdk:
return RLMLogCategory.realmSDK
return RLMLogCategory.SDK
case Category.app:
return RLMLogCategory.realmApp
return RLMLogCategory.app
case Category.Storage.all:
return RLMLogCategory.realmStorage
return RLMLogCategory.storage
case Category.Storage.transaction:
return RLMLogCategory.realmStorageTransaction
return RLMLogCategory.storageTransaction
case Category.Storage.query:
return RLMLogCategory.realmStorageQuery
return RLMLogCategory.storageQuery
case Category.Storage.object:
return RLMLogCategory.realmStorageObject
return RLMLogCategory.storageObject
case Category.Storage.notification:
return RLMLogCategory.realmStorageNotification
return RLMLogCategory.storageNotification
case Category.Sync.all:
return RLMLogCategory.realmSync
return RLMLogCategory.sync
case Category.Sync.Client.all:
return RLMLogCategory.realmSyncClient
return RLMLogCategory.syncClient
case Category.Sync.Client.session:
return RLMLogCategory.realmSyncClientSession
return RLMLogCategory.syncClientSession
case Category.Sync.Client.changeset:
return RLMLogCategory.realmSyncClientChangeset
return RLMLogCategory.syncClientChangeset
case Category.Sync.Client.network:
return RLMLogCategory.realmSyncClientNetwork
return RLMLogCategory.syncClientNetwork
case Category.Sync.Client.reset:
return RLMLogCategory.realmSyncClientReset
return RLMLogCategory.syncClientReset
case Category.Sync.server:
return RLMLogCategory.realmSyncServer
return RLMLogCategory.syncServer
default:
fatalError()
}
Expand All @@ -296,33 +296,33 @@ private extension ObjectiveCSupport {
switch value {
case RLMLogCategory.realm:
return Category.realm
case RLMLogCategory.realmSDK:
case RLMLogCategory.SDK:
return Category.sdk
case RLMLogCategory.realmApp:
case RLMLogCategory.app:
return Category.app
case RLMLogCategory.realmStorage:
case RLMLogCategory.storage:
return Category.Storage.all
case RLMLogCategory.realmStorageTransaction:
case RLMLogCategory.storageTransaction:
return Category.Storage.transaction
case RLMLogCategory.realmStorageQuery:
case RLMLogCategory.storageQuery:
return Category.Storage.query
case RLMLogCategory.realmStorageObject:
case RLMLogCategory.storageObject:
return Category.Storage.object
case RLMLogCategory.realmStorageNotification:
case RLMLogCategory.storageNotification:
return Category.Storage.notification
case RLMLogCategory.realmSync:
case RLMLogCategory.sync:
return Category.Sync.all
case RLMLogCategory.realmSyncClient:
case RLMLogCategory.syncClient:
return Category.Sync.Client.all
case RLMLogCategory.realmSyncClientSession:
case RLMLogCategory.syncClientSession:
return Category.Sync.Client.session
case RLMLogCategory.realmSyncClientChangeset:
case RLMLogCategory.syncClientChangeset:
return Category.Sync.Client.changeset
case RLMLogCategory.realmSyncClientNetwork:
case RLMLogCategory.syncClientNetwork:
return Category.Sync.Client.network
case RLMLogCategory.realmSyncClientReset:
case RLMLogCategory.syncClientReset:
return Category.Sync.Client.reset
case RLMLogCategory.realmSyncServer:
case RLMLogCategory.syncServer:
return Category.Sync.server
default:
fatalError()
Expand Down

0 comments on commit 39bc5d6

Please sign in to comment.