From d5c07a40ab27e3e4021f1c8a881b64cc9e43ff00 Mon Sep 17 00:00:00 2001 From: Renaud Allard Date: Mon, 17 Oct 2016 18:14:34 +0200 Subject: Log which filters have been used --- src/org/traccar/FilterHandler.java | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index 1ce9e2460..8acc06935 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -150,16 +150,40 @@ public class FilterHandler extends BaseDataHandler { private boolean filter(Position p) { + String filterType = ""; + boolean result = filterInvalid(p) || filterZero(p) || filterDuplicate(p) || filterFuture(p) || filterApproximate(p) || filterStatic(p) || filterDistance(p); + if (filterInvalid(p)) { + filterType = "Invalid "; + } + if (filterZero(p)) { + filterType = (filterType + "Zero "); + } + if (filterDuplicate(p)) { + filterType = (filterType + "Duplicate "); + } + if (filterFuture(p)) { + filterType = (filterType + "Future "); + } + if (filterApproximate(p)) { + filterType = (filterType + "Approximate "); + } + if (filterStatic(p)) { + filterType = (filterType + "Static "); + } + if (filterDistance(p)) { + filterType = (filterType + "Distance "); + } + if (filterLimit(p)) { result = false; } if (result) { - Log.info("Position filtered from " + p.getDeviceId()); + Log.info("Position filtered by " + filterType + "filters from " + p.getDeviceId()); } return result; -- cgit v1.2.3