From 6438de2c82b126307f481791ddf2bbc8cf78d597 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 3 Apr 2020 18:33:19 +0300 Subject: [PATCH] Add logs to nav drawer logo loading --- .../net/osmand/plus/OsmAndAppCustomization.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java b/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java index 3a3bc100b0..52a13098bc 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java @@ -17,6 +17,7 @@ import androidx.annotation.Nullable; import net.osmand.AndroidUtils; import net.osmand.IProgress; import net.osmand.IndexConstants; +import net.osmand.PlatformUtil; import net.osmand.aidl.ConnectedApp; import net.osmand.data.LocationPoint; import net.osmand.plus.activities.MapActivity; @@ -31,6 +32,7 @@ import net.osmand.plus.routing.RouteCalculationResult; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.util.Algorithms; +import org.apache.commons.logging.Log; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -58,6 +60,8 @@ public class OsmAndAppCustomization { private static final int MAX_NAV_DRAWER_ITEMS_PER_APP = 3; + private static final Log LOG = PlatformUtil.getLog(OsmAndAppCustomization.class); + protected OsmandApplication app; protected OsmandSettings osmandSettings; @@ -241,7 +245,7 @@ public class OsmAndAppCustomization { } } } catch (JSONException e) { - e.printStackTrace(); + LOG.error("Failed to read json", e); } } } @@ -276,12 +280,12 @@ public class OsmAndAppCustomization { try { is.close(); } catch (IOException e) { - e.printStackTrace(); + LOG.error(e); } try { fout.close(); } catch (IOException e) { - e.printStackTrace(); + LOG.error(e); } } JSONObject json = new JSONObject(); @@ -291,9 +295,9 @@ public class OsmAndAppCustomization { } catch (FileNotFoundException e) { return false; } catch (JSONException e) { - // ignore + LOG.error("Failed to read json", e); } catch (IOException e) { - // ignore + LOG.error("Failed to write file", e); } if (packageName != null && intent != null) { navDrawerParams = new ArrayList<>();