From b6257e226f3c18ffc703a616a22101ba8ad539fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Basl=C3=A9?= Date: Mon, 29 Jun 2015 20:51:24 +0200 Subject: [PATCH] only evaluate debug log is isDebugEnabled --- .../core/mapping/event/ValidatingCouchbaseEventListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java b/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java index 18468288..fbbb4c0b 100644 --- a/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java +++ b/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java @@ -54,7 +54,9 @@ public class ValidatingCouchbaseEventListener extends AbstractCouchbaseEventList @SuppressWarnings({"rawtypes", "unchecked"}) public void onBeforeSave(Object source, CouchbaseDocument dbo) { - LOG.debug("Validating object: {}", source); + if (LOG.isDebugEnabled()) { + LOG.debug("Validating object: {}", source); + } Set violations = validator.validate(source); if (!violations.isEmpty()) {