Repository: usergrid
Updated Branches:
  refs/heads/master a652838d1 -> d8d1dedcb


Hide unnecessary warn message behind DEBUG.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/56c995f6
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/56c995f6
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/56c995f6

Branch: refs/heads/master
Commit: 56c995f6b78be60aca43b31392537fddd1e6c255
Parents: e15cb12
Author: Michael Russo <[email protected]>
Authored: Thu Mar 3 11:05:39 2016 -0800
Committer: Michael Russo <[email protected]>
Committed: Thu Mar 3 11:05:39 2016 -0800

----------------------------------------------------------------------
 .../model/entity/MapToEntityConverter.java        | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/56c995f6/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
 
b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
index fb19963..b5ffd74 100644
--- 
a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
+++ 
b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
@@ -186,8 +186,11 @@ public class MapToEntityConverter{
                         "Latitude and longitude must be doubles (e.g. 
32.1234).");
                 }
             } else if (m.containsKey("lat") && m.containsKey("lon")) {
-                logger.warn("Entity contains latitude and longitude in old 
format location{lat,long}"
-                );
+
+                if(logger.isDebugEnabled()){
+                    logger.debug("Entity contains latitude and longitude in 
old format location{lat,long}");
+                }
+
                 try {
                     latVal = Double.parseDouble(m.get("lat").toString());
                     lonVal = Double.parseDouble(m.get("lon").toString());
@@ -202,10 +205,13 @@ public class MapToEntityConverter{
 
            return new LocationField(fieldName, new Location(latVal, lonVal));
         } else {
-            //can't process non enties
-            logger.warn(
-                "entity cannot process location values that don't have valid 
location{latitude,longitude} values, changing to generic object"
-            );
+
+            if(logger.isDebugEnabled()){
+                logger.debug(
+                    "entity cannot process location values that don't have 
valid " +
+                        "location{latitude,longitude} values, changing to 
generic object");
+            }
+
            return new EntityObjectField(fieldName,fromMap( value, false)); // 
recursion
         }
     }

Reply via email to