From 3e8cde2edeac00c07ded5298e313d63c4c8c5b6c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 23 Apr 2016 01:01:22 +1200 Subject: Print unique id in the log file --- src/org/traccar/MainEventHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java index f99765de4..1be20c291 100644 --- a/src/org/traccar/MainEventHandler.java +++ b/src/org/traccar/MainEventHandler.java @@ -36,10 +36,12 @@ public class MainEventHandler extends IdleStateAwareChannelHandler { Position position = (Position) e.getMessage(); + String uniqueId = Context.getDataManager().getDeviceById(position.getDeviceId()).getUniqueId(); + // Log position StringBuilder s = new StringBuilder(); s.append(formatChannel(e.getChannel())).append(" "); - s.append("id: ").append(position.getDeviceId()).append(", "); + s.append("id: ").append(uniqueId).append(", "); s.append("time: ").append( new SimpleDateFormat(Log.DATE_FORMAT).format(position.getFixTime())).append(", "); s.append("lat: ").append(String.format("%.5f", position.getLatitude())).append(", "); -- cgit v1.2.3