diff options
| author | Keith Packard <keithp@keithp.com> | 2018-10-06 22:27:20 -0600 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2018-10-06 22:27:20 -0600 | 
| commit | 02adfb13297f7dffcd8edcdd3b8747cf52b2a70b (patch) | |
| tree | 167accb901a22de1f2412a4dee8a4e9904575a89 /map-server/altos-mapd/AltosMapdClient.java | |
| parent | 839e3a413a60c6a61851a94cc299de701ab5c277 (diff) | |
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 <keithp@keithp.com>
Diffstat (limited to 'map-server/altos-mapd/AltosMapdClient.java')
| -rw-r--r-- | map-server/altos-mapd/AltosMapdClient.java | 12 | 
1 files 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");  		}  	} | 
