@@ -215,19 +215,27 @@ public:
215
215
// Encode replicator options dict:
216
216
alloc_slice options = encodeOptions ();
217
217
params.optionsDictFleece = options;
218
+
219
+ // Generate replicator id for logging purpose:
220
+ std::stringstream ss;
221
+ ss << " CBLRepl@" << (void *)this ;
222
+ auto replID = ss.str ();
223
+ _replicatorID = alloc_slice (replID);
218
224
219
225
// Create the LiteCore replicator:
220
226
_db->useLocked ([&](C4Database *c4db) {
221
227
#ifdef COUCHBASE_ENTERPRISE
222
228
if (_conf.endpoint ->otherLocalDB ()) {
223
229
_c4repl = c4db->newLocalReplicator (_conf.endpoint ->otherLocalDB ()->useLocked ().get (),
224
- params);
230
+ params,
231
+ _replicatorID);
225
232
} else
226
233
#endif
227
234
{
228
235
_c4repl = c4db->newReplicator (_conf.endpoint ->remoteAddress (),
229
236
_conf.endpoint ->remoteDatabaseName (),
230
- params);
237
+ params,
238
+ _replicatorID);
231
239
}
232
240
});
233
241
@@ -542,6 +550,7 @@ private:
542
550
Retained<CBLDatabase> _db;
543
551
Retained<CBLCollection> _defaultCollection;
544
552
Retained<C4Replicator> _c4repl;
553
+ alloc_slice _replicatorID;
545
554
unique_ptr<CBLReplicatorStoppable> _stoppable;
546
555
ReplicationCollectionsMap _collections; // For filters and conflict resolver
547
556
bool _useInitialStatus; // For returning status before first start
0 commit comments