Polishing.
Consistent log field ordering, serialize sort safely. See #4686 Original pull request: #4679
This commit is contained in:
@@ -561,8 +561,8 @@ public class MongoTemplate
|
||||
Document fieldsObject = query.getFieldsObject();
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format("Executing query: %s sort: %s fields: %s in collection: %s",
|
||||
serializeToJsonSafely(queryObject), sortObject, fieldsObject, collectionName));
|
||||
LOGGER.debug(String.format("Executing query: %s fields: %s sort: %s in collection: %s",
|
||||
serializeToJsonSafely(queryObject), fieldsObject, serializeToJsonSafely(sortObject), collectionName));
|
||||
}
|
||||
|
||||
this.executeQueryInternal(new FindCallback(createDelegate(query), queryObject, fieldsObject, null),
|
||||
@@ -2555,7 +2555,8 @@ public class MongoTemplate
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format("find using query: %s fields: %s sort: %s for class: %s in collection: %s",
|
||||
serializeToJsonSafely(mappedQuery), mappedSort, mappedFields, entityClass, collectionName));
|
||||
serializeToJsonSafely(mappedQuery), mappedFields, serializeToJsonSafely(mappedSort), entityClass,
|
||||
collectionName));
|
||||
}
|
||||
|
||||
return executeFindMultiInternal(new FindCallback(collectionPreparer, mappedQuery, mappedFields, null),
|
||||
@@ -2581,7 +2582,8 @@ public class MongoTemplate
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format("find using query: %s fields: %s sort: %s for class: %s in collection: %s",
|
||||
serializeToJsonSafely(mappedQuery), mappedSort, mappedFields, sourceClass, collectionName));
|
||||
serializeToJsonSafely(mappedQuery), mappedFields, serializeToJsonSafely(mappedSort), sourceClass,
|
||||
collectionName));
|
||||
}
|
||||
|
||||
return executeFindMultiInternal(new FindCallback(collectionPreparer, mappedQuery, mappedFields, null), preparer,
|
||||
@@ -2665,7 +2667,7 @@ public class MongoTemplate
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format("findAndRemove using query: %s fields: %s sort: %s for class: %s in collection: %s",
|
||||
serializeToJsonSafely(query), fields, sort, entityClass, collectionName));
|
||||
serializeToJsonSafely(query), fields, serializeToJsonSafely(sort), entityClass, collectionName));
|
||||
}
|
||||
|
||||
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityClass);
|
||||
@@ -2698,7 +2700,8 @@ public class MongoTemplate
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format(
|
||||
"findAndModify using query: %s fields: %s sort: %s for class: %s and update: %s in collection: %s",
|
||||
serializeToJsonSafely(mappedQuery), fields, sort, entityClass, serializeToJsonSafely(mappedUpdate),
|
||||
serializeToJsonSafely(mappedQuery), fields, serializeToJsonSafely(sort), entityClass,
|
||||
serializeToJsonSafely(mappedUpdate),
|
||||
collectionName));
|
||||
}
|
||||
|
||||
|
||||
@@ -2399,7 +2399,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format("findAndRemove using query: %s fields: %s sort: %s for class: %s in collection: %s",
|
||||
serializeToJsonSafely(query), fields, sort, entityClass, collectionName));
|
||||
serializeToJsonSafely(query), fields, serializeToJsonSafely(sort), entityClass, collectionName));
|
||||
}
|
||||
|
||||
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityClass);
|
||||
@@ -2426,7 +2426,8 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format(
|
||||
"findAndModify using query: %s fields: %s sort: %s for class: %s and update: %s " + "in collection: %s",
|
||||
serializeToJsonSafely(mappedQuery), fields, sort, entityClass, serializeToJsonSafely(mappedUpdate),
|
||||
serializeToJsonSafely(mappedQuery), fields, serializeToJsonSafely(sort), entityClass,
|
||||
serializeToJsonSafely(mappedUpdate),
|
||||
collectionName));
|
||||
}
|
||||
|
||||
@@ -2493,7 +2494,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
LOGGER.debug(String.format(
|
||||
"findAndReplace using query: %s fields: %s sort: %s for class: %s and replacement: %s "
|
||||
+ "in collection: %s",
|
||||
serializeToJsonSafely(mappedQuery), mappedFields, mappedSort, entityType,
|
||||
serializeToJsonSafely(mappedQuery), mappedFields, serializeToJsonSafely(mappedSort), entityType,
|
||||
serializeToJsonSafely(replacement), collectionName));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user