diff options
-rw-r--r-- | src/org/traccar/FilterHandler.java | 11 | ||||
-rw-r--r-- | test/org/traccar/FilterHandlerTest.java | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index 83d79a3c0..f9904ccaf 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -175,7 +175,16 @@ public class FilterHandler extends BaseDataHandler { } if (filterType.length() > 0 && !filterLimit(position)) { - Log.info("Position filtered by " + filterType.toString() + "filters from " + position.getDeviceId()); + + StringBuilder message = new StringBuilder(); + message.append("Position filtered by "); + message.append(filterType.toString()); + message.append("filters from device: "); + message.append(Context.getIdentityManager().getDeviceById(position.getDeviceId()).getUniqueId()); + message.append(" with id: "); + message.append(position.getDeviceId()); + + Log.info(message.toString()); return true; } diff --git a/test/org/traccar/FilterHandlerTest.java b/test/org/traccar/FilterHandlerTest.java index bb7e69dc0..a03c04536 100644 --- a/test/org/traccar/FilterHandlerTest.java +++ b/test/org/traccar/FilterHandlerTest.java @@ -6,15 +6,19 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import org.junit.Before; import org.junit.Test; +import org.traccar.database.IdentityManager; import org.traccar.model.Position; +import org.traccar.model.Device; public class FilterHandlerTest { + private EventHandlerTest deviceHandler; private FilterHandler filtingHandler; private FilterHandler passingHandler; @Before public void setUp() { + deviceHandler = new EventHandlerTest(); passingHandler = new FilterHandler(); filtingHandler = new FilterHandler(); filtingHandler.setFilterInvalid(true); @@ -32,7 +36,7 @@ public class FilterHandlerTest { filtingHandler = null; passingHandler = null; } - + private Position createPosition( long deviceId, Date time, |