Skip to content

Commit 81568ef

Browse files
authored
Better logging for sessions (#6552)
1 parent aef9e48 commit 81568ef

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 5.13.0(YYYY-MM-DD)
2+
3+
### Enhancements
4+
* [ObjectServer] Improved session lifecycle debug output. (Issue [#6552](https://github.com/realm/realm-java/pull/6552)).
5+
6+
### Fixed
7+
* None.
8+
9+
### Compatibility
10+
* Realm Object Server: 3.21.0 or later.
11+
* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
12+
* APIs are backwards compatible with all previous release of realm-java in the 5.x.y series.
13+
14+
### Internal
15+
* None.
16+
17+
118
## 5.12.0(2019-06-20)
219

320
### Enhancements

realm/realm-library/src/main/cpp/io_realm_internal_OsRealmConfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ JNIEXPORT jstring JNICALL Java_io_realm_internal_OsRealmConfig_nativeCreateAndSe
334334
// the session which should be bound.
335335
auto bind_handler = [](const std::string& path, const SyncConfig& syncConfig,
336336
std::shared_ptr<SyncSession> session) {
337-
realm::jni_util::Log::d("Callback to Java requesting token for path");
337+
realm::jni_util::Log::d("Callback to Java requesting token for path: %1", path.c_str());
338338

339339
JNIEnv* env = realm::jni_util::JniUtils::get_env(true);
340340

realm/realm-library/src/objectServer/java/io/realm/SyncManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ public static synchronized SyncSession getOrCreateSession(SyncConfiguration sync
266266

267267
SyncSession session = sessions.get(syncConfiguration.getPath());
268268
if (session == null) {
269+
RealmLog.debug("Creating session for: %s", syncConfiguration.getPath());
269270
session = new SyncSession(syncConfiguration);
270271
sessions.put(syncConfiguration.getPath(), session);
271272
if (sessions.size() == 1) {
@@ -437,12 +438,13 @@ private static synchronized void removeSession(SyncConfiguration syncConfigurati
437438
if (syncConfiguration == null) {
438439
throw new IllegalArgumentException("A non-empty 'syncConfiguration' is required.");
439440
}
441+
RealmLog.debug("Removing session for: %s", syncConfiguration.getPath());
440442
SyncSession syncSession = sessions.remove(syncConfiguration.getPath());
441443
if (syncSession != null) {
442444
syncSession.close();
443445
}
444446
if (sessions.isEmpty()) {
445-
RealmLog.debug("last session dropped, remove network listener");
447+
RealmLog.debug("Last session dropped. Remove network listener.");
446448
NetworkStateReceiver.removeListener(networkListener);
447449
}
448450
}

realm/realm-library/src/objectServer/java/io/realm/internal/network/AuthenticateResponse.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public static AuthenticateResponse createValidResponseWithUser(String identifier
106106
* @param error the network or I/O error.
107107
*/
108108
private AuthenticateResponse(ObjectServerError error) {
109-
RealmLog.debug("AuthenticateResponse - Error: " + error);
110109
setError(error);
111110
this.accessToken = null;
112111
this.refreshToken = null;

0 commit comments

Comments
 (0)