diff --git a/src/CBLReplicator_Internal.hh b/src/CBLReplicator_Internal.hh index 5d8d4013..2673eb31 100644 --- a/src/CBLReplicator_Internal.hh +++ b/src/CBLReplicator_Internal.hh @@ -215,19 +215,27 @@ public: // Encode replicator options dict: alloc_slice options = encodeOptions(); params.optionsDictFleece = options; + + // Generate replicator id for logging purpose: + std::stringstream ss; + ss << "CBLRepl@" << (void*)this; + auto replID = ss.str(); + _replicatorID = alloc_slice(replID); // Create the LiteCore replicator: _db->useLocked([&](C4Database *c4db) { #ifdef COUCHBASE_ENTERPRISE if (_conf.endpoint->otherLocalDB()) { _c4repl = c4db->newLocalReplicator(_conf.endpoint->otherLocalDB()->useLocked().get(), - params); + params, + _replicatorID); } else #endif { _c4repl = c4db->newReplicator(_conf.endpoint->remoteAddress(), _conf.endpoint->remoteDatabaseName(), - params); + params, + _replicatorID); } }); @@ -542,6 +550,7 @@ private: Retained _db; Retained _defaultCollection; Retained _c4repl; + alloc_slice _replicatorID; unique_ptr _stoppable; ReplicationCollectionsMap _collections; // For filters and conflict resolver bool _useInitialStatus; // For returning status before first start diff --git a/vendor/couchbase-lite-core b/vendor/couchbase-lite-core index 476a079a..cd86d178 160000 --- a/vendor/couchbase-lite-core +++ b/vendor/couchbase-lite-core @@ -1 +1 @@ -Subproject commit 476a079a57ab4076c927ed3a0e81cd50a54b1cbd +Subproject commit cd86d17833af595a719191500c2eb117a333b935