From 02adfb13297f7dffcd8edcdd3b8747cf52b2a70b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 6 Oct 2018 22:27:20 -0600 Subject: [PATCH] altos-mapd: Clean up log messages Generate a single log message per request with remote address, parameters and result code. Signed-off-by: Keith Packard --- map-server/altos-mapd/AltosMapdClient.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/map-server/altos-mapd/AltosMapdClient.java b/map-server/altos-mapd/AltosMapdClient.java index 70ceae82..09833363 100644 --- a/map-server/altos-mapd/AltosMapdClient.java +++ b/map-server/altos-mapd/AltosMapdClient.java @@ -26,7 +26,10 @@ public class AltosMapdClient extends Thread implements AltosMapStoreListener { private AltosJson request; private AltosJson reply; + private int http_status; + private void set_status(int status) { + http_status = status; reply.put("status", status); } @@ -83,8 +86,6 @@ public class AltosMapdClient extends Thread implements AltosMapStoreListener { store_ready = new Semaphore(0); - System.out.printf("Fetching tile for %g %g %d\n", lat, lon, zoom); - AltosMapStore map_store = AltosMapStore.get(new AltosLatLon(lat, lon), zoom, AltosMapd.maptype, @@ -93,13 +94,10 @@ public class AltosMapdClient extends Thread implements AltosMapStoreListener { int status; if (map_store == null) { - System.out.printf("no store?\n"); status = AltosMapTile.failed; } else { map_store.add_listener(this); - System.out.printf("Waiting for tile\n"); - try { store_ready.acquire(); } catch (Exception ie) { @@ -123,6 +121,9 @@ public class AltosMapdClient extends Thread implements AltosMapStoreListener { set_status(400); } } + System.out.printf("%s: %.6f %.6f %d status %d\n", + addr, lat, lon, zoom, http_status); + } catch (Exception e) { System.out.printf("client exception %s\n", e.toString()); e.printStackTrace(System.out); @@ -140,7 +141,6 @@ public class AltosMapdClient extends Thread implements AltosMapStoreListener { socket.close(); } catch (IOException ie) { } - System.out.printf("client done\n"); } } -- 2.30.2