diff options
Diffstat (limited to 'main/src/cgeo')
68 files changed, 430 insertions, 458 deletions
diff --git a/main/src/cgeo/geocaching/AdressListActivity.java b/main/src/cgeo/geocaching/AdressListActivity.java index 39b9f22..57d3cdd 100644 --- a/main/src/cgeo/geocaching/AdressListActivity.java +++ b/main/src/cgeo/geocaching/AdressListActivity.java @@ -49,7 +49,7 @@ public class AdressListActivity extends AbstractListActivity { try { return geocoder.getFromLocationName(keyword, 20); } catch (Exception e) { - Log.e(Settings.tag, "AdressListActivity.doInBackground", e); + Log.e("AdressListActivity.doInBackground", e); return null; } } @@ -68,7 +68,7 @@ public class AdressListActivity extends AbstractListActivity { } } } catch (Exception e) { - Log.e(Settings.tag, "AdressListActivity.onPostExecute", e); + Log.e("AdressListActivity.onPostExecute", e); } } diff --git a/main/src/cgeo/geocaching/CacheCache.java b/main/src/cgeo/geocaching/CacheCache.java index 1ebb47f..95b8b19 100644 --- a/main/src/cgeo/geocaching/CacheCache.java +++ b/main/src/cgeo/geocaching/CacheCache.java @@ -91,7 +91,7 @@ public class CacheCache { if (cache.getCoords() == null) { // FIXME: this kludge must be removed, it is only present to help us debug the cases where // caches contain null coordinates. - Log.e(Settings.tag, "CacheCache.getInViewport: got cache with null coordinates: " + cache.getGeocode()); + Log.e("CacheCache.getInViewport: got cache with null coordinates: " + cache.getGeocode()); continue; } if ((CacheType.ALL == cacheType || cache.getType() == cacheType) && diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 755115a..bcfd273 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -219,9 +219,9 @@ public class CacheDetailActivity extends AbstractActivity { String uriQuery = uri.getQuery(); if (uriQuery != null) { - Log.i(Settings.tag, "Opening URI: " + uriHost + uriPath + "?" + uriQuery); + Log.i("Opening URI: " + uriHost + uriPath + "?" + uriQuery); } else { - Log.i(Settings.tag, "Opening URI: " + uriHost + uriPath); + Log.i("Opening URI: " + uriHost + uriPath); } if (uriHost.contains("geocaching.com")) { @@ -743,7 +743,7 @@ public class CacheDetailActivity extends AbstractActivity { cacheDistanceView.setText(dist.toString()); cacheDistanceView.bringToFront(); } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } @@ -1019,7 +1019,7 @@ public class CacheDetailActivity extends AbstractActivity { ((ViewPager) container).addView(view, 0); } } catch (Exception e) { - Log.e(Settings.tag, "ViewPagerAdapter.instantiateItem ", e); + Log.e("ViewPagerAdapter.instantiateItem ", e); } return view; @@ -1844,7 +1844,7 @@ public class CacheDetailActivity extends AbstractActivity { final HtmlImage mapGetter = new HtmlImage(CacheDetailActivity.this, cache.getGeocode(), false, 0, false); image = mapGetter.getDrawable("http://maps.google.com/maps/api/staticmap?zoom=15&size=" + width + "x" + height + "&maptype=roadmap&markers=icon%3A" + markerUrl + "%7Cshadow:false%7C" + latlonMap + "&sensor=false"); } catch (Exception e) { - Log.w(Settings.tag, "CacheDetailActivity.PreviewMapTask", e); + Log.w("CacheDetailActivity.PreviewMapTask", e); } return image; diff --git a/main/src/cgeo/geocaching/Settings.java b/main/src/cgeo/geocaching/Settings.java index b52571a..872c3f6 100644 --- a/main/src/cgeo/geocaching/Settings.java +++ b/main/src/cgeo/geocaching/Settings.java @@ -110,9 +110,6 @@ public final class Settings { } } - // FIXME: tag should be private member of our log class - public static final String tag = "cgeo"; - private static String username = null; private static String password = null; diff --git a/main/src/cgeo/geocaching/StaticMapsActivity.java b/main/src/cgeo/geocaching/StaticMapsActivity.java index f9d023f..fdb6d67 100644 --- a/main/src/cgeo/geocaching/StaticMapsActivity.java +++ b/main/src/cgeo/geocaching/StaticMapsActivity.java @@ -78,7 +78,7 @@ public class StaticMapsActivity extends AbstractActivity { if (waitDialog != null) { waitDialog.dismiss(); } - Log.e(Settings.tag, "StaticMapsActivity.loadMapsHandler: " + e.toString()); + Log.e("StaticMapsActivity.loadMapsHandler: " + e.toString()); } } }; @@ -160,7 +160,7 @@ public class StaticMapsActivity extends AbstractActivity { } } } catch (Exception e) { - Log.e(Settings.tag, "StaticMapsActivity.LoadMapsThread.run.1: " + e.toString()); + Log.e("StaticMapsActivity.LoadMapsThread.run.1: " + e.toString()); } } @@ -179,14 +179,14 @@ public class StaticMapsActivity extends AbstractActivity { } } } catch (Exception e) { - Log.e(Settings.tag, "StaticMapsActivity.LoadMapsThread.run.2: " + e.toString()); + Log.e("StaticMapsActivity.LoadMapsThread.run.2: " + e.toString()); } } } loadMapsHandler.sendMessage(Message.obtain()); } catch (Exception e) { - Log.e(Settings.tag, "StaticMapsActivity.LoadMapsThread.run: " + e.toString()); + Log.e("StaticMapsActivity.LoadMapsThread.run: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/StaticMapsProvider.java b/main/src/cgeo/geocaching/StaticMapsProvider.java index 17601af..920089c 100644 --- a/main/src/cgeo/geocaching/StaticMapsProvider.java +++ b/main/src/cgeo/geocaching/StaticMapsProvider.java @@ -154,7 +154,7 @@ public class StaticMapsProvider { try { pool.add(currentTask, 20, TimeUnit.SECONDS); } catch (InterruptedException e) { - Log.e(Settings.tag, "StaticMapsProvider.downloadMaps error adding task: " + e.toString()); + Log.e("StaticMapsProvider.downloadMaps error adding task: " + e.toString()); } } } @@ -182,7 +182,7 @@ public class StaticMapsProvider { StaticMapsProvider.getMapFile(geocode, "wp" + wp_id + "_", level, false).delete(); } } catch (Exception e) { - Log.e(Settings.tag, "StaticMapsProvider.removeWpStaticMaps: " + e.toString()); + Log.e("StaticMapsProvider.removeWpStaticMaps: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/VisitCacheActivity.java b/main/src/cgeo/geocaching/VisitCacheActivity.java index a471483..73a681b 100644 --- a/main/src/cgeo/geocaching/VisitCacheActivity.java +++ b/main/src/cgeo/geocaching/VisitCacheActivity.java @@ -370,7 +370,7 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D if (viewId == R.id.type) { for (final LogType typeOne : possibleLogTypes) { menu.add(viewId, typeOne.id, 0, typeOne.getL10n()); - Log.w(Settings.tag, "Adding " + typeOne + " " + typeOne.getL10n()); + Log.w("Adding " + typeOne + " " + typeOne.getL10n()); } } else if (viewId == R.id.changebutton) { final int textId = ((TextView) findViewById(viewId)).getId(); @@ -426,7 +426,7 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D return true; } } catch (Exception e) { - Log.e(Settings.tag, "cgeovisit.onContextItemSelected: " + e.toString()); + Log.e("cgeovisit.onContextItemSelected: " + e.toString()); } } else { try { @@ -449,14 +449,14 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D tb.action = logType; tbText.setText(res.getString(logType.resourceId) + " ▼"); - Log.i(Settings.tag, "Trackable " + tb.trackCode + " (" + tb.name + ") has new action: #" + id); + Log.i("Trackable " + tb.trackCode + " (" + tb.name + ") has new action: #" + id); } } return true; } } catch (Exception e) { - Log.e(Settings.tag, "cgeovisit.onContextItemSelected: " + e.toString()); + Log.e("cgeovisit.onContextItemSelected: " + e.toString()); } } @@ -668,7 +668,7 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D possibleLogTypes.remove(LogType.LOG_UPDATE_COORDINATES); } } catch (Exception e) { - Log.e(Settings.tag, "cgeovisit.loadData.run: " + e.toString()); + Log.e("cgeovisit.loadData.run: " + e.toString()); } loadDataHandler.sendEmptyMessage(0); @@ -741,7 +741,7 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D return status; } catch (Exception e) { - Log.e(Settings.tag, "cgeovisit.postLogFn: " + e.toString()); + Log.e("cgeovisit.postLogFn: " + e.toString()); } return StatusCode.LOG_POST_ERROR; diff --git a/main/src/cgeo/geocaching/apps/AbstractLocusApp.java b/main/src/cgeo/geocaching/apps/AbstractLocusApp.java index 1ccf8dc..80e2dac 100644 --- a/main/src/cgeo/geocaching/apps/AbstractLocusApp.java +++ b/main/src/cgeo/geocaching/apps/AbstractLocusApp.java @@ -1,7 +1,6 @@ package cgeo.geocaching.apps; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgWaypoint; import cgeo.geocaching.enumerations.CacheSize; @@ -112,7 +111,7 @@ public abstract class AbstractLocusApp extends AbstractApp { } // create one simple point with location - final Location loc = new Location(Settings.tag); + final Location loc = new Location("cgeo"); loc.setLatitude(cache.getCoords().getLatitude()); loc.setLongitude(cache.getCoords().getLongitude()); @@ -191,7 +190,7 @@ public abstract class AbstractLocusApp extends AbstractApp { } // create one simple point with location - final Location loc = new Location(Settings.tag); + final Location loc = new Location("cgeo"); loc.setLatitude(waypoint.getCoords().getLatitude()); loc.setLongitude(waypoint.getCoords().getLongitude()); diff --git a/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java b/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java index df5e991..49db025 100644 --- a/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java +++ b/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java @@ -1,6 +1,5 @@ package cgeo.geocaching.apps.cache; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; import cgeo.geocaching.apps.AbstractAppFactory; import cgeo.geocaching.utils.Log; @@ -37,7 +36,7 @@ public final class GeneralAppsFactory extends AbstractAppFactory { try { return app.invoke(activity, cache); } catch (Exception e) { - Log.e(Settings.tag, "GeneralAppsFactory.onMenuItemSelected: " + e.toString()); + Log.e("GeneralAppsFactory.onMenuItemSelected: " + e.toString()); } } return false; diff --git a/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java b/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java index 878bbb8..24aa693 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/GoogleMapsApp.java @@ -1,7 +1,6 @@ package cgeo.geocaching.apps.cache.navi; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.activity.ActivityMixin; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.utils.Log; @@ -32,7 +31,7 @@ class GoogleMapsApp extends AbstractPointNavigationApp { } catch (Exception e) { // nothing } - Log.i(Settings.tag, "cgBase.runExternalMap: No maps application available."); + Log.i("cgBase.runExternalMap: No maps application available."); ActivityMixin.showToast(activity, getString(R.string.err_application_no)); } diff --git a/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java b/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java index a3d335c..74141c3 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java @@ -84,8 +84,7 @@ class GoogleNavigationApp extends AbstractNavigationApp { // nothing } - Log.i(Settings.tag, - "cgBase.runNavigation: No navigation application available."); + Log.i("cgBase.runNavigation: No navigation application available."); return false; } diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java index 8bb54b7..ec7dd0f 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java @@ -257,7 +257,7 @@ public final class NavigationAppFactory extends AbstractAppFactory { try { return app.invoke(geo, activity, cache, waypoint, destination); } catch (Exception e) { - Log.e(Settings.tag, "NavigationAppFactory.onMenuItemSelected: " + e.toString()); + Log.e("NavigationAppFactory.onMenuItemSelected: " + e.toString()); } } return false; @@ -291,7 +291,7 @@ public final class NavigationAppFactory extends AbstractAppFactory { try { app.invoke(geo, activity, cache, waypoint, destination); } catch (Exception e) { - Log.e(Settings.tag, "NavigationAppFactory.startDefaultNavigationApplication: " + e.toString()); + Log.e("NavigationAppFactory.startDefaultNavigationApplication: " + e.toString()); } } } @@ -314,7 +314,7 @@ public final class NavigationAppFactory extends AbstractAppFactory { try { app.invoke(geo, activity, cache, waypoint, destination); } catch (Exception e) { - Log.e(Settings.tag, "NavigationAppFactory.startDefaultNavigationApplication2: " + e.toString()); + Log.e("NavigationAppFactory.startDefaultNavigationApplication2: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java b/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java index a73ac4d..c8f201d 100644 --- a/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java +++ b/main/src/cgeo/geocaching/apps/cachelist/CacheListAppFactory.java @@ -2,7 +2,6 @@ package cgeo.geocaching.apps.cachelist; import cgeo.geocaching.R; import cgeo.geocaching.SearchResult; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgGeo; import cgeo.geocaching.activity.IAbstractActivity; @@ -73,7 +72,7 @@ public final class CacheListAppFactory extends AbstractAppFactory { activity.invalidateOptionsMenuCompatible(); return result; } catch (Exception e) { - Log.e(Settings.tag, "CacheListAppFactory.onMenuItemSelected: " + e.toString()); + Log.e("CacheListAppFactory.onMenuItemSelected: " + e.toString()); } } return false; diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java index a1bb980..5144840 100644 --- a/main/src/cgeo/geocaching/cgBase.java +++ b/main/src/cgeo/geocaching/cgBase.java @@ -92,7 +92,7 @@ public class cgBase { final PackageInfo info = manager.getPackageInfo(app.getPackageName(), 0); version = info.versionName; } catch (PackageManager.NameNotFoundException e) { - Log.e(Settings.tag, "unable to get version information", e); + Log.e("unable to get version information", e); version = null; } } @@ -123,7 +123,7 @@ public class cgBase { private static SearchResult parseSearch(final cgSearchThread thread, final String url, final String pageContent, final boolean showCaptcha) { if (StringUtils.isBlank(pageContent)) { - Log.e(Settings.tag, "cgeoBase.parseSearch: No page given"); + Log.e("cgeoBase.parseSearch: No page given"); return null; } @@ -162,7 +162,7 @@ public class cgBase { int startPos = page.indexOf("<div id=\"ctl00_ContentBody_ResultsPanel\""); if (startPos == -1) { - Log.e(Settings.tag, "cgeoBase.parseSearch: ID \"ctl00_ContentBody_dlResults\" not found on page"); + Log.e("cgeoBase.parseSearch: ID \"ctl00_ContentBody_dlResults\" not found on page"); return null; } @@ -171,7 +171,7 @@ public class cgBase { startPos = page.indexOf('>'); int endPos = page.indexOf("ctl00_ContentBody_UnitTxt"); if (startPos == -1 || endPos == -1) { - Log.e(Settings.tag, "cgeoBase.parseSearch: ID \"ctl00_ContentBody_UnitTxt\" not found on page"); + Log.e("cgeoBase.parseSearch: ID \"ctl00_ContentBody_UnitTxt\" not found on page"); return null; } @@ -214,7 +214,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse GUID and/or Disabled - Log.w(Settings.tag, "cgeoBase.parseSearch: Failed to parse GUID and/or Disabled data"); + Log.w("cgeoBase.parseSearch: Failed to parse GUID and/or Disabled data"); } if (Settings.isExcludeDisabledCaches() && (cache.isDisabled() || cache.isArchived())) { @@ -282,7 +282,7 @@ public class cgBase { cache.setFavoritePoints(Integer.parseInt(result)); } } catch (NumberFormatException e) { - Log.w(Settings.tag, "cgeoBase.parseSearch: Failed to parse favourite count"); + Log.w("cgeoBase.parseSearch: Failed to parse favourite count"); } if (cache.getNameSp() == null) { @@ -302,7 +302,7 @@ public class cgBase { searchResult.setTotal(Integer.parseInt(result)); } } catch (NumberFormatException e) { - Log.w(Settings.tag, "cgeoBase.parseSearch: Failed to parse cache count"); + Log.w("cgeoBase.parseSearch: Failed to parse cache count"); } if (thread != null && recaptchaChallenge != null) { @@ -314,7 +314,7 @@ public class cgBase { } if (cids.size() > 0 && (Settings.isPremiumMember() || showCaptcha) && (recaptchaChallenge == null || StringUtils.isNotBlank(recaptchaText))) { - Log.i(Settings.tag, "Trying to get .loc for " + cids.size() + " caches"); + Log.i("Trying to get .loc for " + cids.size() + " caches"); try { // get coordinates for parsed caches @@ -344,7 +344,7 @@ public class cgBase { if (StringUtils.isNotBlank(coordinates)) { if (coordinates.contains("You have not agreed to the license agreement. The license agreement is required before you can start downloading GPX or LOC files from Geocaching.com")) { - Log.i(Settings.tag, "User has not agreed to the license agreement. Can\'t download .loc file."); + Log.i("User has not agreed to the license agreement. Can\'t download .loc file."); searchResult.setError(StatusCode.UNAPPROVED_LICENSE); @@ -355,7 +355,7 @@ public class cgBase { LocParser.parseLoc(searchResult, coordinates); } catch (Exception e) { - Log.e(Settings.tag, "cgBase.parseSearch.CIDs: " + e.toString()); + Log.e("cgBase.parseSearch.CIDs: " + e.toString()); } } @@ -396,7 +396,7 @@ public class cgBase { sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_details); if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.parseCache: No page given"); + Log.e("cgeoBase.parseCache: No page given"); return null; } @@ -456,7 +456,7 @@ public class cgBase { int pos = tableInside.indexOf("id=\"cacheDetails\""); if (pos == -1) { - Log.e(Settings.tag, "cgeoBase.parseCache: ID \"cacheDetails\" not found on page"); + Log.e("cgeoBase.parseCache: ID \"cacheDetails\" not found on page"); return null; } @@ -464,7 +464,7 @@ public class cgBase { pos = tableInside.indexOf("<div class=\"CacheInformationTable\""); if (pos == -1) { - Log.e(Settings.tag, "cgeoBase.parseCache: class \"CacheInformationTable\" not found on page"); + Log.e("cgeoBase.parseCache: class \"CacheInformationTable\" not found on page"); return null; } @@ -501,7 +501,7 @@ public class cgBase { } } catch (ParseException e) { // failed to parse cache hidden date - Log.w(Settings.tag, "cgeoBase.parseCache: Failed to parse cache hidden (event) date"); + Log.w("cgeoBase.parseCache: Failed to parse cache hidden (event) date"); } // favourite @@ -527,7 +527,7 @@ public class cgBase { cache.setCoords(new Geopoint(cache.getLatlon())); cache.setReliableLatLon(true); } catch (Geopoint.GeopointException e) { - Log.w(Settings.tag, "cgeoBase.parseCache: Failed to parse cache coordinates: " + e.toString()); + Log.w("cgeoBase.parseCache: Failed to parse cache coordinates: " + e.toString()); } } @@ -581,7 +581,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse cache attributes - Log.w(Settings.tag, "cgeoBase.parseCache: Failed to parse cache attributes"); + Log.w("cgeoBase.parseCache: Failed to parse cache attributes"); } // cache spoilers @@ -618,7 +618,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse cache spoilers - Log.w(Settings.tag, "cgeoBase.parseCache: Failed to parse cache spoilers"); + Log.w("cgeoBase.parseCache: Failed to parse cache spoilers"); } // cache inventory @@ -652,7 +652,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse cache inventory - Log.w(Settings.tag, "cgeoBase.parseCache: Failed to parse cache inventory (2)"); + Log.w("cgeoBase.parseCache: Failed to parse cache inventory (2)"); } // cache logs counts @@ -677,7 +677,7 @@ public class cgBase { } catch (Exception e) { // failed to parse logs - Log.w(Settings.tag, "cgeoBase.parseCache: Failed to parse cache log count"); + Log.w("cgeoBase.parseCache: Failed to parse cache log count"); } // add waypoint for original coordinates in case of user-modified listing-coordinates @@ -840,7 +840,7 @@ public class cgBase { if (!getDataFromPage) { final Matcher userTokenMatcher = GCConstants.PATTERN_USERTOKEN2.matcher(page); if (!userTokenMatcher.find()) { - Log.e(Settings.tag, "cgBase.loadLogsFromDetails: unable to extract userToken"); + Log.e("cgBase.loadLogsFromDetails: unable to extract userToken"); return null; } @@ -855,17 +855,17 @@ public class cgBase { final HttpResponse response = Network.request("http://www.geocaching.com/seek/geocache.logbook", params, false, false, false); if (response == null) { - Log.e(Settings.tag, "cgBase.loadLogsFromDetails: cannot log logs, response is null"); + Log.e("cgBase.loadLogsFromDetails: cannot log logs, response is null"); return null; } final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200) { - Log.e(Settings.tag, "cgBase.loadLogsFromDetails: error " + statusCode + " when requesting log information"); + Log.e("cgBase.loadLogsFromDetails: error " + statusCode + " when requesting log information"); return null; } rawResponse = Network.getResponseData(response); if (rawResponse == null) { - Log.e(Settings.tag, "cgBase.loadLogsFromDetails: unable to read whole response"); + Log.e("cgBase.loadLogsFromDetails: unable to read whole response"); return null; } } else { @@ -878,7 +878,7 @@ public class cgBase { try { final JSONObject resp = new JSONObject(rawResponse); if (!resp.getString("status").equals("success")) { - Log.e(Settings.tag, "cgBase.loadLogsFromDetails: status is " + resp.getString("status")); + Log.e("cgBase.loadLogsFromDetails: status is " + resp.getString("status")); return null; } @@ -897,7 +897,7 @@ public class cgBase { try { logDone.date = Login.parseGcCustomDate(entry.getString("Visited")).getTime(); } catch (ParseException e) { - Log.e(Settings.tag, "cgBase.loadLogsFromDetails: failed to parse log date."); + Log.e("cgBase.loadLogsFromDetails: failed to parse log date."); } logDone.author = entry.getString("UserName"); @@ -920,7 +920,7 @@ public class cgBase { } } catch (JSONException e) { // failed to parse logs - Log.w(Settings.tag, "cgBase.loadLogsFromDetails: Failed to parse cache logs", e); + Log.w("cgBase.loadLogsFromDetails: Failed to parse cache logs", e); } return logs; @@ -928,43 +928,43 @@ public class cgBase { private static void checkFields(cgCache cache) { if (StringUtils.isBlank(cache.getGeocode())) { - Log.e(Settings.tag, "cgBase.loadLogsFromDetails: geo code not parsed correctly"); + Log.e("cgBase.loadLogsFromDetails: geo code not parsed correctly"); } if (StringUtils.isBlank(cache.getName())) { - Log.e(Settings.tag, "name not parsed correctly"); + Log.e("name not parsed correctly"); } if (StringUtils.isBlank(cache.getGuid())) { - Log.e(Settings.tag, "guid not parsed correctly"); + Log.e("guid not parsed correctly"); } if (cache.getTerrain() == 0.0) { - Log.e(Settings.tag, "terrain not parsed correctly"); + Log.e("terrain not parsed correctly"); } if (cache.getDifficulty() == 0.0) { - Log.e(Settings.tag, "difficulty not parsed correctly"); + Log.e("difficulty not parsed correctly"); } if (StringUtils.isBlank(cache.getOwner())) { - Log.e(Settings.tag, "owner not parsed correctly"); + Log.e("owner not parsed correctly"); } if (StringUtils.isBlank(cache.getOwnerReal())) { - Log.e(Settings.tag, "owner real not parsed correctly"); + Log.e("owner real not parsed correctly"); } if (cache.getHiddenDate() == null) { - Log.e(Settings.tag, "hidden not parsed correctly"); + Log.e("hidden not parsed correctly"); } if (cache.getFavoritePoints() < 0) { - Log.e(Settings.tag, "favoriteCount not parsed correctly"); + Log.e("favoriteCount not parsed correctly"); } if (cache.getSize() == null) { - Log.e(Settings.tag, "size not parsed correctly"); + Log.e("size not parsed correctly"); } if (cache.getType() == null || cache.getType() == CacheType.UNKNOWN) { - Log.e(Settings.tag, "type not parsed correctly"); + Log.e("type not parsed correctly"); } if (cache.getCoords() == null) { - Log.e(Settings.tag, "coordinates not parsed correctly"); + Log.e("coordinates not parsed correctly"); } if (StringUtils.isBlank(cache.getLocation())) { - Log.e(Settings.tag, "location not parsed correctly"); + Log.e("location not parsed correctly"); } } @@ -979,7 +979,7 @@ public class cgBase { */ public static cgTrackable parseTrackable(final String page, final cgeoapplication app, final String possibleTrackingcode) { if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.parseTrackable: No page given"); + Log.e("cgeoBase.parseTrackable: No page given"); return null; } @@ -1011,7 +1011,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse trackable owner name - Log.w(Settings.tag, "cgeoBase.parseTrackable: Failed to parse trackable owner name"); + Log.w("cgeoBase.parseTrackable: Failed to parse trackable owner name"); } // trackable origin @@ -1042,7 +1042,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse trackable last known place - Log.w(Settings.tag, "cgeoBase.parseTrackable: Failed to parse trackable last known place"); + Log.w("cgeoBase.parseTrackable: Failed to parse trackable last known place"); } // released date - can be missing on the page @@ -1088,7 +1088,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse trackable details & image - Log.w(Settings.tag, "cgeoBase.parseTrackable: Failed to parse trackable details & image"); + Log.w("cgeoBase.parseTrackable: Failed to parse trackable details & image"); } // trackable logs @@ -1144,7 +1144,7 @@ public class cgBase { } } catch (Exception e) { // failed to parse logs - Log.w(Settings.tag, "cgeoBase.parseCache: Failed to parse cache logs" + e.toString()); + Log.w("cgeoBase.parseCache: Failed to parse cache logs" + e.toString()); } // trackingcode @@ -1207,7 +1207,7 @@ public class cgBase { table = StringUtils.substringBetween(table, "<tbody>", "</tbody>"); if (StringUtils.isBlank(table)) { - Log.e(Settings.tag, "cgeoBase.parseTrackableLog: tbody not found on page"); + Log.e("cgeoBase.parseTrackableLog: tbody not found on page"); return null; } @@ -1237,7 +1237,7 @@ public class cgBase { continue; } - Log.i(Settings.tag, "Trackable in inventory (#" + trackableLog.ctl + "/" + trackableLog.id + "): " + trackableLog.trackCode + " - " + trackableLog.name); + Log.i("Trackable in inventory (#" + trackableLog.ctl + "/" + trackableLog.id + "): " + trackableLog.trackCode + " - " + trackableLog.name); trackables.add(trackableLog); } @@ -1267,12 +1267,12 @@ public class cgBase { final String url = search.getUrl(); if (StringUtils.isBlank(url)) { - Log.e(Settings.tag, "cgeoBase.searchByNextPage: No url found"); + Log.e("cgeoBase.searchByNextPage: No url found"); return search; } if (isEmpty(viewstates)) { - Log.e(Settings.tag, "cgeoBase.searchByNextPage: No viewstate given"); + Log.e("cgeoBase.searchByNextPage: No viewstate given"); return search; } @@ -1290,22 +1290,22 @@ public class cgBase { if (loginState == StatusCode.NO_ERROR) { page = Network.getResponseData(Network.postRequest(uri, params)); } else if (loginState == StatusCode.NO_LOGIN_INFO_STORED) { - Log.i(Settings.tag, "Working as guest."); + Log.i("Working as guest."); } else { search.setError(loginState); - Log.e(Settings.tag, "cgeoBase.searchByNextPage: Can not log in geocaching"); + Log.e("cgeoBase.searchByNextPage: Can not log in geocaching"); return search; } } if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.searchByNextPage: No data from server"); + Log.e("cgeoBase.searchByNextPage: No data from server"); return search; } final SearchResult searchResult = parseSearch(thread, url, page, showCaptcha); if (searchResult == null || CollectionUtils.isEmpty(searchResult.getGeocodes())) { - Log.e(Settings.tag, "cgeoBase.searchByNextPage: No cache parsed"); + Log.e("cgeoBase.searchByNextPage: No cache parsed"); return search; } @@ -1320,7 +1320,7 @@ public class cgBase { public static SearchResult searchByGeocode(final String geocode, final String guid, final int listId, final boolean forceReload, final CancellableHandler handler) { if (StringUtils.isBlank(geocode) && StringUtils.isBlank(guid)) { - Log.e(Settings.tag, "cgeoBase.searchByGeocode: No geocode nor guid given"); + Log.e("cgeoBase.searchByGeocode: No geocode nor guid given"); return null; } @@ -1362,13 +1362,13 @@ public class cgBase { String page = Network.requestLogged(uri, params, false, my, true); if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.searchByAny: No data from server"); + Log.e("cgeoBase.searchByAny: No data from server"); return null; } final SearchResult searchResult = parseSearch(thread, fullUri, page, showCaptcha); if (searchResult == null || CollectionUtils.isEmpty(searchResult.getGeocodes())) { - Log.e(Settings.tag, "cgeoBase.searchByAny: No cache parsed"); + Log.e("cgeoBase.searchByAny: No cache parsed"); return searchResult; } @@ -1386,7 +1386,7 @@ public class cgBase { public static SearchResult searchByKeyword(final cgSearchThread thread, final String keyword, final CacheType cacheType, final boolean showCaptcha) { if (StringUtils.isBlank(keyword)) { - Log.e(Settings.tag, "cgeoBase.searchByKeyword: No keyword given"); + Log.e("cgeoBase.searchByKeyword: No keyword given"); return null; } @@ -1396,7 +1396,7 @@ public class cgBase { public static SearchResult searchByUsername(final cgSearchThread thread, final String userName, final CacheType cacheType, final boolean showCaptcha) { if (StringUtils.isBlank(userName)) { - Log.e(Settings.tag, "cgeoBase.searchByUsername: No user name given"); + Log.e("cgeoBase.searchByUsername: No user name given"); return null; } @@ -1405,7 +1405,7 @@ public class cgBase { boolean my = false; if (userName.equalsIgnoreCase(Settings.getLogin().left)) { my = true; - Log.i(Settings.tag, "cgBase.searchByUsername: Overriding users choice, downloading all caches."); + Log.i("cgBase.searchByUsername: Overriding users choice, downloading all caches."); } return searchByAny(thread, cacheType, my, showCaptcha, params); @@ -1413,7 +1413,7 @@ public class cgBase { public static SearchResult searchByOwner(final cgSearchThread thread, final String userName, final CacheType cacheType, final boolean showCaptcha) { if (StringUtils.isBlank(userName)) { - Log.e(Settings.tag, "cgeoBase.searchByOwner: No user name given"); + Log.e("cgeoBase.searchByOwner: No user name given"); return null; } @@ -1423,7 +1423,7 @@ public class cgBase { public static cgTrackable searchTrackable(final String geocode, final String guid, final String id) { if (StringUtils.isBlank(geocode) && StringUtils.isBlank(guid) && StringUtils.isBlank(id)) { - Log.w(Settings.tag, "cgeoBase.searchTrackable: No geocode nor guid nor id given"); + Log.w("cgeoBase.searchTrackable: No geocode nor guid nor id given"); return null; } @@ -1442,13 +1442,13 @@ public class cgBase { String page = Network.requestLogged("http://www.geocaching.com/track/details.aspx", params, false, false, false); if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.searchTrackable: No data from server"); + Log.e("cgeoBase.searchTrackable: No data from server"); return trackable; } trackable = parseTrackable(page, cgeoapplication.getInstance(), geocode); if (trackable == null) { - Log.e(Settings.tag, "cgeoBase.searchTrackable: No trackable parsed"); + Log.e("cgeoBase.searchTrackable: No trackable parsed"); return null; } @@ -1459,12 +1459,12 @@ public class cgBase { final LogType logType, final int year, final int month, final int day, final String log, final List<cgTrackableLog> trackables) { if (isEmpty(viewstates)) { - Log.e(Settings.tag, "cgeoBase.postLog: No viewstate given"); + Log.e("cgeoBase.postLog: No viewstate given"); return StatusCode.LOG_POST_ERROR; } if (StringUtils.isBlank(log)) { - Log.e(Settings.tag, "cgeoBase.postLog: No log text given"); + Log.e("cgeoBase.postLog: No log text given"); return StatusCode.NO_LOG_TEXT; } @@ -1487,9 +1487,9 @@ public class cgBase { final String logInfo = logUpdated.toString().replace("\n", "\r\n").trim(); // windows' eol and remove leading and trailing whitespaces if (trackables != null) { - Log.i(Settings.tag, "Trying to post log for cache #" + cacheid + " - action: " + logType + "; date: " + year + "." + month + "." + day + ", log: " + logInfo + "; trackables: " + trackables.size()); + Log.i("Trying to post log for cache #" + cacheid + " - action: " + logType + "; date: " + year + "." + month + "." + day + ", log: " + logInfo + "; trackables: " + trackables.size()); } else { - Log.i(Settings.tag, "Trying to post log for cache #" + cacheid + " - action: " + logType + "; date: " + year + "." + month + "." + day + ", log: " + logInfo + "; trackables: 0"); + Log.i("Trying to post log for cache #" + cacheid + " - action: " + logType + "; date: " + year + "." + month + "." + day + ", log: " + logInfo + "; trackables: 0"); } final Parameters params = new Parameters( @@ -1527,13 +1527,13 @@ public class cgBase { if (loginState == StatusCode.NO_ERROR) { page = Network.getResponseData(Network.postRequest(uri, params)); } else { - Log.e(Settings.tag, "cgeoBase.postLog: Can not log in geocaching (error: " + loginState + ")"); + Log.e("cgeoBase.postLog: Can not log in geocaching (error: " + loginState + ")"); return loginState; } } if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.postLog: No data from server"); + Log.e("cgeoBase.postLog: No data from server"); return StatusCode.NO_DATA_FROM_SERVER; } @@ -1546,7 +1546,7 @@ public class cgBase { final String[] viewstatesConfirm = Login.getViewstates(page); if (isEmpty(viewstatesConfirm)) { - Log.e(Settings.tag, "cgeoBase.postLog: No viewstate for confirm log"); + Log.e("cgeoBase.postLog: No viewstate for confirm log"); return StatusCode.LOG_POST_ERROR; } @@ -1585,14 +1585,14 @@ public class cgBase { page = Network.getResponseData(Network.postRequest(uri, params)); } } catch (Exception e) { - Log.e(Settings.tag, "cgeoBase.postLog.confim: " + e.toString()); + Log.e("cgeoBase.postLog.confim: " + e.toString()); } try { final Matcher matcherOk = GCConstants.PATTERN_OK1.matcher(page); if (matcherOk.find()) { - Log.i(Settings.tag, "Log successfully posted to cache #" + cacheid); + Log.i("Log successfully posted to cache #" + cacheid); if (geocode != null) { cgeoapplication.getInstance().saveVisitDate(geocode); @@ -1606,26 +1606,26 @@ public class cgBase { return StatusCode.NO_ERROR; } } catch (Exception e) { - Log.e(Settings.tag, "cgeoBase.postLog.check: " + e.toString()); + Log.e("cgeoBase.postLog.check: " + e.toString()); } - Log.e(Settings.tag, "cgeoBase.postLog: Failed to post log because of unknown error"); + Log.e("cgeoBase.postLog: Failed to post log because of unknown error"); return StatusCode.LOG_POST_ERROR; } public static StatusCode postLogTrackable(final String tbid, final String trackingCode, final String[] viewstates, final LogType logType, final int year, final int month, final int day, final String log) { if (isEmpty(viewstates)) { - Log.e(Settings.tag, "cgeoBase.postLogTrackable: No viewstate given"); + Log.e("cgeoBase.postLogTrackable: No viewstate given"); return StatusCode.LOG_POST_ERROR; } if (StringUtils.isBlank(log)) { - Log.e(Settings.tag, "cgeoBase.postLogTrackable: No log text given"); + Log.e("cgeoBase.postLogTrackable: No log text given"); return StatusCode.NO_LOG_TEXT; } - Log.i(Settings.tag, "Trying to post log for trackable #" + trackingCode + " - action: " + logType + "; date: " + year + "." + month + "." + day + ", log: " + log); + Log.i("Trying to post log for trackable #" + trackingCode + " - action: " + logType + "; date: " + year + "." + month + "." + day + ", log: " + log); final String logInfo = log.replace("\n", "\r\n"); // windows' eol @@ -1657,13 +1657,13 @@ public class cgBase { if (loginState == StatusCode.NO_ERROR) { page = Network.getResponseData(Network.postRequest(uri, params)); } else { - Log.e(Settings.tag, "cgeoBase.postLogTrackable: Can not log in geocaching (error: " + loginState + ")"); + Log.e("cgeoBase.postLogTrackable: Can not log in geocaching (error: " + loginState + ")"); return loginState; } } if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.postLogTrackable: No data from server"); + Log.e("cgeoBase.postLogTrackable: No data from server"); return StatusCode.NO_DATA_FROM_SERVER; } @@ -1671,14 +1671,14 @@ public class cgBase { final Matcher matcherOk = GCConstants.PATTERN_OK2.matcher(page); if (matcherOk.find()) { - Log.i(Settings.tag, "Log successfully posted to trackable #" + trackingCode); + Log.i("Log successfully posted to trackable #" + trackingCode); return StatusCode.NO_ERROR; } } catch (Exception e) { - Log.e(Settings.tag, "cgeoBase.postLogTrackable.check: " + e.toString()); + Log.e("cgeoBase.postLogTrackable.check: " + e.toString()); } - Log.e(Settings.tag, "cgeoBase.postLogTrackable: Failed to post log because of unknown error"); + Log.e("cgeoBase.postLogTrackable: Failed to post log because of unknown error"); return StatusCode.LOG_POST_ERROR; } @@ -1694,16 +1694,16 @@ public class cgBase { String page = Network.postRequestLogged(uri); if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgBase.addToWatchlist: No data from server"); + Log.e("cgBase.addToWatchlist: No data from server"); return -1; // error } boolean guidOnPage = cache.isGuidContainedInPage(page); if (guidOnPage) { - Log.i(Settings.tag, "cgBase.addToWatchlist: cache is on watchlist"); + Log.i("cgBase.addToWatchlist: cache is on watchlist"); cache.setOnWatchlist(true); } else { - Log.e(Settings.tag, "cgBase.addToWatchlist: cache is not on watchlist"); + Log.e("cgBase.addToWatchlist: cache is not on watchlist"); } return guidOnPage ? 1 : -1; // on watchlist (=added) / else: error } @@ -1720,7 +1720,7 @@ public class cgBase { String page = Network.postRequestLogged(uri); if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgBase.removeFromWatchlist: No data from server"); + Log.e("cgBase.removeFromWatchlist: No data from server"); return -1; // error } @@ -1734,10 +1734,10 @@ public class cgBase { page = Network.getResponseData(Network.postRequest(uri, params)); boolean guidOnPage = cache.isGuidContainedInPage(page); if (!guidOnPage) { - Log.i(Settings.tag, "cgBase.removeFromWatchlist: cache removed from watchlist"); + Log.i("cgBase.removeFromWatchlist: cache removed from watchlist"); cache.setOnWatchlist(false); } else { - Log.e(Settings.tag, "cgBase.removeFromWatchlist: cache not removed from watchlist"); + Log.e("cgBase.removeFromWatchlist: cache not removed from watchlist"); } return guidOnPage ? -1 : 0; // on watchlist (=error) / not on watchlist } @@ -1757,7 +1757,7 @@ public class cgBase { return new Parameters("f", "1"); } params.put("f", "1"); - Log.i(Settings.tag, "Skipping caches found or hidden by user."); + Log.i("Skipping caches found or hidden by user."); } return params; @@ -1845,7 +1845,7 @@ public class cgBase { handler.sendMessage(Message.obtain()); } } catch (Exception e) { - Log.e(Settings.tag, "cgBase.storeCache"); + Log.e("cgBase.storeCache"); } } @@ -1861,7 +1861,7 @@ public class cgBase { handler.sendMessage(Message.obtain()); } catch (Exception e) { - Log.e(Settings.tag, "cgBase.dropCache: " + e.toString()); + Log.e("cgBase.dropCache: " + e.toString()); } } diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java index f2a773d..8eeee8d 100644 --- a/main/src/cgeo/geocaching/cgCache.java +++ b/main/src/cgeo/geocaching/cgCache.java @@ -392,10 +392,10 @@ public class cgCache implements ICache, IWaypoint { Pattern patternOk = Pattern.compile(guid, Pattern.CASE_INSENSITIVE); Matcher matcherOk = patternOk.matcher(page); if (matcherOk.find()) { - Log.i(Settings.tag, "cgCache.isGuidContainedInPage: guid '" + guid + "' found"); + Log.i("cgCache.isGuidContainedInPage: guid '" + guid + "' found"); return true; } else { - Log.i(Settings.tag, "cgCache.isGuidContainedInPage: guid '" + guid + "' not found"); + Log.i("cgCache.isGuidContainedInPage: guid '" + guid + "' not found"); return false; } } @@ -1338,7 +1338,7 @@ public class cgCache implements ICache, IWaypoint { matcher = coordPattern.matcher(note); } } catch (Exception e) { - Log.e(Settings.tag, "cgCache.parseWaypointsFromNote: " + e.toString()); + Log.e("cgCache.parseWaypointsFromNote: " + e.toString()); } } diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java index 281d098..4a013dd 100644 --- a/main/src/cgeo/geocaching/cgData.java +++ b/main/src/cgeo/geocaching/cgData.java @@ -266,16 +266,16 @@ public class cgData { databaseRW = dbHelper.getWritableDatabase(); if (databaseRW != null && databaseRW.isOpen()) { - Log.i(Settings.tag, "Connection to RW database established."); + Log.i("Connection to RW database established."); } else { - Log.e(Settings.tag, "Failed to open connection to RW database."); + Log.e("Failed to open connection to RW database."); } if (databaseRW != null && databaseRW.inTransaction()) { databaseRW.endTransaction(); } } catch (Exception e) { - Log.e(Settings.tag, "cgData.openDb.RW: " + e.toString()); + Log.e("cgData.openDb.RW: " + e.toString()); } } @@ -291,16 +291,16 @@ public class cgData { } if (databaseRO != null && databaseRO.isOpen()) { - Log.i(Settings.tag, "Connection to RO database established."); + Log.i("Connection to RO database established."); } else { - Log.e(Settings.tag, "Failed to open connection to RO database."); + Log.e("Failed to open connection to RO database."); } if (databaseRO != null && databaseRO.inTransaction()) { databaseRO.endTransaction(); } } catch (Exception e) { - Log.e(Settings.tag, "cgData.openDb.RO: " + e.toString()); + Log.e("cgData.openDb.RO: " + e.toString()); } } @@ -325,7 +325,7 @@ public class cgData { databaseRO = null; SQLiteDatabase.releaseMemory(); - Log.d(Settings.tag, "Closing RO database"); + Log.d("Closing RO database"); } if (databaseRW != null) { @@ -339,7 +339,7 @@ public class cgData { databaseRW = null; SQLiteDatabase.releaseMemory(); - Log.d(Settings.tag, "Closing RW database"); + Log.d("Closing RW database"); } if (dbHelper != null) { @@ -360,7 +360,7 @@ public class cgData { public String backupDatabase() { if (!LocalStorage.isExternalStorageAvailable()) { - Log.w(Settings.tag, "Database wasn't backed up: no external memory"); + Log.w("Database wasn't backed up: no external memory"); return null; } @@ -370,10 +370,10 @@ public class cgData { init(); if (backupDone) { - Log.i(Settings.tag, "Database was copied to " + target); + Log.i("Database was copied to " + target); return target.getPath(); } else { - Log.e(Settings.tag, "Database could not be copied to " + target); + Log.e("Database could not be copied to " + target); return null; } } @@ -389,7 +389,7 @@ public class cgData { public boolean restoreDatabase() { if (!LocalStorage.isExternalStorageAvailable()) { - Log.w(Settings.tag, "Database wasn't restored: no external memory"); + Log.w("Database wasn't restored: no external memory"); return false; } @@ -399,9 +399,9 @@ public class cgData { init(); if (restoreDone) { - Log.i(Settings.tag, "Database succesfully restored from " + sourceFile.getPath()); + Log.i("Database succesfully restored from " + sourceFile.getPath()); } else { - Log.e(Settings.tag, "Could not restore database from " + sourceFile.getPath()); + Log.e("Could not restore database from " + sourceFile.getPath()); } return restoreDone; @@ -452,7 +452,7 @@ public class cgData { @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - Log.i(Settings.tag, "Upgrade database from ver. " + oldVersion + " to ver. " + newVersion + ": start"); + Log.i("Upgrade database from ver. " + oldVersion + " to ver. " + newVersion + ": start"); try { if (db.isReadOnly()) { @@ -465,7 +465,7 @@ public class cgData { dropDatabase(db); onCreate(db); - Log.i(Settings.tag, "Database structure created."); + Log.i("Database structure created."); } if (oldVersion > 0) { @@ -485,9 +485,9 @@ public class cgData { db.execSQL("create index if not exists in_a on " + dbTableLogs + " (geocode)"); db.execSQL("create index if not exists in_a on " + dbTableTrackables + " (geocode)"); - Log.i(Settings.tag, "Indexes added."); + Log.i("Indexes added."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 34: " + e.toString()); + Log.e("Failed to upgrade to ver. 34: " + e.toString()); } } @@ -496,9 +496,9 @@ public class cgData { db.execSQL("alter table " + dbTableCaches + " add column direction text"); db.execSQL("alter table " + dbTableCaches + " add column distance double"); - Log.i(Settings.tag, "Columns direction and distance added to " + dbTableCaches + "."); + Log.i("Columns direction and distance added to " + dbTableCaches + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 37: " + e.toString()); + Log.e("Failed to upgrade to ver. 37: " + e.toString()); } } @@ -507,9 +507,9 @@ public class cgData { db.execSQL("drop table " + dbTableLogs); db.execSQL(dbCreateLogs); - Log.i(Settings.tag, "Changed type column in " + dbTableLogs + " to integer."); + Log.i("Changed type column in " + dbTableLogs + " to integer."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 38: " + e.toString()); + Log.e("Failed to upgrade to ver. 38: " + e.toString()); } } @@ -517,9 +517,9 @@ public class cgData { try { db.execSQL(dbCreateLists); - Log.i(Settings.tag, "Created lists table."); + Log.i("Created lists table."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 39: " + e.toString()); + Log.e("Failed to upgrade to ver. 39: " + e.toString()); } } @@ -528,9 +528,9 @@ public class cgData { db.execSQL("drop table " + dbTableTrackables); db.execSQL(dbCreateTrackables); - Log.i(Settings.tag, "Changed type of geocode column in trackables table."); + Log.i("Changed type of geocode column in trackables table."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 40: " + e.toString()); + Log.e("Failed to upgrade to ver. 40: " + e.toString()); } } @@ -540,9 +540,9 @@ public class cgData { db.execSQL("alter table " + dbTableCaches + " add column votes integer"); db.execSQL("alter table " + dbTableCaches + " add column vote integer"); - Log.i(Settings.tag, "Added columns for GCvote."); + Log.i("Added columns for GCvote."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 41: " + e.toString()); + Log.e("Failed to upgrade to ver. 41: " + e.toString()); } } @@ -550,9 +550,9 @@ public class cgData { try { db.execSQL(dbCreateLogsOffline); - Log.i(Settings.tag, "Added table for offline logs"); + Log.i("Added table for offline logs"); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 42: " + e.toString()); + Log.e("Failed to upgrade to ver. 42: " + e.toString()); } } @@ -648,9 +648,9 @@ public class cgData { db.execSQL("drop table " + dbTableCachesTemp); db.setTransactionSuccessful(); - Log.i(Settings.tag, "Changed direction column"); + Log.i("Changed direction column"); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 43: " + e.toString()); + Log.e("Failed to upgrade to ver. 43: " + e.toString()); } finally { db.endTransaction(); } @@ -660,9 +660,9 @@ public class cgData { try { db.execSQL("alter table " + dbTableCaches + " add column favourite_cnt integer"); - Log.i(Settings.tag, "Column favourite_cnt added to " + dbTableCaches + "."); + Log.i("Column favourite_cnt added to " + dbTableCaches + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 44: " + e.toString()); + Log.e("Failed to upgrade to ver. 44: " + e.toString()); } } @@ -670,9 +670,9 @@ public class cgData { try { db.execSQL("alter table " + dbTableCaches + " add column owner_real text"); - Log.i(Settings.tag, "Column owner_real added to " + dbTableCaches + "."); + Log.i("Column owner_real added to " + dbTableCaches + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 45: " + e.toString()); + Log.e("Failed to upgrade to ver. 45: " + e.toString()); } } @@ -681,18 +681,18 @@ public class cgData { db.execSQL("alter table " + dbTableCaches + " add column visiteddate long"); db.execSQL("create index if not exists in_f on " + dbTableCaches + " (visiteddate, detailedupdate)"); - Log.i(Settings.tag, "Added column for date of visit."); + Log.i("Added column for date of visit."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 46: " + e.toString()); + Log.e("Failed to upgrade to ver. 46: " + e.toString()); } } if (oldVersion < 47) { // upgrade to 47 try { db.execSQL("alter table " + dbTableCaches + " add column own integer not null default 0"); - Log.i(Settings.tag, "Added column own."); + Log.i("Added column own."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 47: " + e.toString()); + Log.e("Failed to upgrade to ver. 47: " + e.toString()); } } @@ -700,9 +700,9 @@ public class cgData { try { db.execSQL("alter table " + dbTableCaches + " add column elevation double"); - Log.i(Settings.tag, "Column elevation added to " + dbTableCaches + "."); + Log.i("Column elevation added to " + dbTableCaches + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 48: " + e.toString()); + Log.e("Failed to upgrade to ver. 48: " + e.toString()); } } @@ -710,9 +710,9 @@ public class cgData { try { db.execSQL(dbCreateLogCount); - Log.i(Settings.tag, "Created table " + dbTableLogCount + "."); + Log.i("Created table " + dbTableLogCount + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 49: " + e.toString()); + Log.e("Failed to upgrade to ver. 49: " + e.toString()); } } @@ -720,9 +720,9 @@ public class cgData { try { db.execSQL("alter table " + dbTableCaches + " add column myvote float"); - Log.i(Settings.tag, "Added float column for votes to " + dbTableCaches + "."); + Log.i("Added float column for votes to " + dbTableCaches + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 50: " + e.toString()); + Log.e("Failed to upgrade to ver. 50: " + e.toString()); } } @@ -730,9 +730,9 @@ public class cgData { try { db.execSQL("alter table " + dbTableCaches + " add column reliable_latlon integer"); - Log.i(Settings.tag, "Column reliable_latlon added to " + dbTableCaches + "."); + Log.i("Column reliable_latlon added to " + dbTableCaches + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 51: " + e.toString()); + Log.e("Failed to upgrade to ver. 51: " + e.toString()); } } @@ -740,9 +740,9 @@ public class cgData { try { db.execSQL(dbCreateSearchDestinationHistory); - Log.i(Settings.tag, "Added table " + dbTableSearchDestionationHistory + "."); + Log.i("Added table " + dbTableSearchDestionationHistory + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 52", e); + Log.e("Failed to upgrade to ver. 52", e); } } @@ -750,9 +750,9 @@ public class cgData { try { db.execSQL("alter table " + dbTableCaches + " add column onWatchlist integer"); - Log.i(Settings.tag, "Column onWatchlist added to " + dbTableCaches + "."); + Log.i("Column onWatchlist added to " + dbTableCaches + "."); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 53", e); + Log.e("Failed to upgrade to ver. 53", e); } } @@ -760,7 +760,7 @@ public class cgData { try { db.execSQL(dbCreateLogImages); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 54: " + e.toString()); + Log.e("Failed to upgrade to ver. 54: " + e.toString()); } } @@ -769,7 +769,7 @@ public class cgData { try { db.execSQL("alter table " + dbTableCaches + " add column personal_note text"); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 55: " + e.toString()); + Log.e("Failed to upgrade to ver. 55: " + e.toString()); } } @@ -781,7 +781,7 @@ public class cgData { "lower(attribute) where attribute like \"%_yes\" " + "or attribute like \"%_no\""); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 56: " + e.toString()); + Log.e("Failed to upgrade to ver. 56: " + e.toString()); } } @@ -796,7 +796,7 @@ public class cgData { db.execSQL("drop index in_f"); createIndices(db); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 57: " + e.toString()); + Log.e("Failed to upgrade to ver. 57: " + e.toString()); } } @@ -884,9 +884,9 @@ public class cgData { db.setTransactionSuccessful(); - Log.i(Settings.tag, "Removed latitude_string and longitude_string columns"); + Log.i("Removed latitude_string and longitude_string columns"); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 58", e); + Log.e("Failed to upgrade to ver. 58", e); } finally { db.endTransaction(); } @@ -898,7 +898,7 @@ public class cgData { createIndices(db); removeObsoleteCacheDirectories(db); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 59", e); + Log.e("Failed to upgrade to ver. 59", e); } } @@ -906,7 +906,7 @@ public class cgData { try { removeSecEmptyDirs(); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 60", e); + Log.e("Failed to upgrade to ver. 60", e); } } if (oldVersion < 61) { @@ -914,7 +914,7 @@ public class cgData { db.execSQL("alter table " + dbTableLogs + " add column friend integer"); db.execSQL("alter table " + dbTableCaches + " add column coordsChanged integer default 0"); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 61: " + e.toString()); + Log.e("Failed to upgrade to ver. 61: " + e.toString()); } } @@ -925,7 +925,7 @@ public class cgData { db.execSQL("alter table " + dbTableWaypoints + " add column own integer default 0"); db.execSQL("update " + dbTableWaypoints + " set own = 1 where type = 'own'"); } catch (Exception e) { - Log.e(Settings.tag, "Failed to upgrade to ver. 62: " + e.toString()); + Log.e("Failed to upgrade to ver. 62: " + e.toString()); } } @@ -936,7 +936,7 @@ public class cgData { db.endTransaction(); } - Log.i(Settings.tag, "Upgrade database from ver. " + oldVersion + " to ver. " + newVersion + ": completed"); + Log.i("Upgrade database from ver. " + oldVersion + " to ver. " + newVersion + ": completed"); } } @@ -969,7 +969,7 @@ public class cgData { @Override public void run() { for (final File dir : toRemove) { - Log.i(Settings.tag, "Removing obsolete cache directory for " + dir.getName()); + Log.i("Removing obsolete cache directory for " + dir.getName()); LocalStorage.deleteDirectory(dir); } } @@ -1033,7 +1033,7 @@ public class cgData { } } } catch (Exception e) { - Log.e(Settings.tag, "cgData.allDetailedThere: " + e.toString()); + Log.e("cgData.allDetailedThere: " + e.toString()); } if (cursor != null) { @@ -1094,7 +1094,7 @@ public class cgData { } } } catch (Exception e) { - Log.e(Settings.tag, "cgData.isThere: " + e.toString()); + Log.e("cgData.isThere: " + e.toString()); } if (cursor != null) { @@ -1172,7 +1172,7 @@ public class cgData { cursor.close(); } } catch (Exception e) { - Log.e(Settings.tag, "cgData.isOffline: " + e.toString()); + Log.e("cgData.isOffline: " + e.toString()); } return listId >= StoredList.STANDARD_LIST_ID; @@ -1193,7 +1193,7 @@ public class cgData { } catch (SQLiteDoneException e) { // Do nothing, it only means we have no information on the cache } catch (Exception e) { - Log.e(Settings.tag, "cgData.getGeocodeForGuid", e); + Log.e("cgData.getGeocodeForGuid", e); } return null; @@ -1214,7 +1214,7 @@ public class cgData { } catch (SQLiteDoneException e) { // Do nothing, it only means we have no information on the cache } catch (Exception e) { - Log.e(Settings.tag, "cgData.getCacheidForGeocode", e); + Log.e("cgData.getCacheidForGeocode", e); } return null; @@ -1255,7 +1255,7 @@ public class cgData { cache.addStorageLocation(StorageLocation.DATABASE); cacheCache.putCacheInCache(cache); - Log.d(Settings.tag, "Saving " + cache.toString() + " (" + cache.getListId() + ") to DB"); + Log.d("Saving " + cache.toString() + " (" + cache.getListId() + ") to DB"); ContentValues values = new ContentValues(); @@ -1428,7 +1428,7 @@ public class cgData { databaseRW.insert(dbTableSearchDestionationHistory, null, values); databaseRW.setTransactionSuccessful(); } catch (Exception e) { - Log.e(Settings.tag, "Updating searchedDestinations db failed", e); + Log.e("Updating searchedDestinations db failed", e); } finally { databaseRW.endTransaction(); } @@ -1441,7 +1441,7 @@ public class cgData { init(); - Log.d(Settings.tag, "cgData.saveWaypoints(drop=" + drop + ")"); + Log.d("cgData.saveWaypoints(drop=" + drop + ")"); boolean ok = false; databaseRW.beginTransaction(); @@ -1846,7 +1846,7 @@ public class cgData { } if (remaining.size() >= 1) { - Log.e(Settings.tag, "cgData.loadCaches(" + remaining.toString() + ") failed"); + Log.e("cgData.loadCaches(" + remaining.toString() + ") failed"); } return result; } @@ -1877,7 +1877,7 @@ public class cgData { throw new IllegalArgumentException("Please use only one parameter"); } - Log.d(Settings.tag, "cgData.loadCaches(" + geocodes.toString() + ") from DB"); + Log.d("cgData.loadCaches(" + geocodes.toString() + ") from DB"); init(); @@ -1967,7 +1967,7 @@ public class cgData { } } } catch (Exception e) { - Log.e(Settings.tag, "cgData.getCaches: " + e.toString()); + Log.e("cgData.getCaches: " + e.toString()); } if (cursor != null) { @@ -2134,7 +2134,7 @@ public class cgData { cache.setUserModifiedCoords(cursor.getInt(cacheColumnIndex[37]) > 0); cache.setFinalDefined(cursor.getInt(cacheColumnIndex[40]) > 0); - Log.d(Settings.tag, "Loading " + cache.toString() + " (" + cache.getListId() + ") from DB"); + Log.d("Loading " + cache.toString() + " (" + cache.getListId() + ") from DB"); return cache; } @@ -2193,7 +2193,7 @@ public class cgData { null, "1"); - Log.d(Settings.tag, "cgData.loadWaypoint(" + id + ")"); + Log.d("cgData.loadWaypoint(" + id + ")"); if (cursor != null && cursor.getCount() > 0) { cursor.moveToFirst(); @@ -2356,7 +2356,7 @@ public class cgData { databaseRW.setTransactionSuccessful(); } catch (Exception e) { success = false; - Log.e(Settings.tag, "Unable to clear searched destinations", e); + Log.e("Unable to clear searched destinations", e); } finally { databaseRW.endTransaction(); } @@ -2591,7 +2591,7 @@ public class cgData { count = (int) compiledStmnt.simpleQueryForLong(); compiledStmnt.close(); } catch (Exception e) { - Log.e(Settings.tag, "cgData.loadAllStoredCachesCount: " + e.toString()); + Log.e("cgData.loadAllStoredCachesCount: " + e.toString()); } return count; @@ -2607,7 +2607,7 @@ public class cgData { count = (int) sqlCount.simpleQueryForLong(); sqlCount.close(); } catch (Exception e) { - Log.e(Settings.tag, "cgData.getAllHistoricCachesCount: " + e.toString()); + Log.e("cgData.getAllHistoricCachesCount: " + e.toString()); } return count; @@ -2665,7 +2665,7 @@ public class cgData { } } catch (Exception e) { - Log.e(Settings.tag, "cgData.loadBatchOfStoredGeocodes: " + e.toString()); + Log.e("cgData.loadBatchOfStoredGeocodes: " + e.toString()); } return geocodes; @@ -2715,7 +2715,7 @@ public class cgData { cursor.close(); } } catch (Exception e) { - Log.e(Settings.tag, "cgData.loadBatchOfHistoricGeocodes: " + e.toString()); + Log.e("cgData.loadBatchOfHistoricGeocodes: " + e.toString()); } return geocodes; @@ -2788,7 +2788,7 @@ public class cgData { } cursor.close(); } catch (Exception e) { - Log.e(Settings.tag, "cgData.loadInViewport: " + e.toString()); + Log.e("cgData.loadInViewport: " + e.toString()); } return geocodes; @@ -2838,7 +2838,7 @@ public class cgData { public void clean(boolean more) { init(); - Log.d(Settings.tag, "Database clean: started"); + Log.d("Database clean: started"); Cursor cursor = null; Set<String> geocodes = new HashSet<String>(); @@ -2883,7 +2883,7 @@ public class cgData { final int size = geocodes.size(); if (size > 0) { - Log.d(Settings.tag, "Database clean: removing " + size + " geocaches from listId=0"); + Log.d("Database clean: removing " + size + " geocaches from listId=0"); removeCaches(geocodes, LoadFlags.REMOVE_ALL); } @@ -2891,13 +2891,13 @@ public class cgData { final SQLiteStatement countSql = databaseRO.compileStatement("select count(_id) from " + dbTableCaches + " where reason = 0"); final int count = (int) countSql.simpleQueryForLong(); countSql.close(); - Log.d(Settings.tag, "Database clean: " + count + " geocaches remaining for listId=0"); + Log.d("Database clean: " + count + " geocaches remaining for listId=0"); } catch (Exception e) { - Log.w(Settings.tag, "cgData.clean: " + e.toString()); + Log.w("cgData.clean: " + e.toString()); } - Log.d(Settings.tag, "Database clean: finished"); + Log.d("Database clean: finished"); } /** @@ -2913,7 +2913,7 @@ public class cgData { values.put("reason", StoredList.TEMPORARY_LIST_ID); databaseRW.update(dbTableCaches, values, "reason = ?", new String[] { Integer.toString(listId) }); } catch (Exception e) { - Log.e(Settings.tag, "cgData.dropList: error when updating reason", e); + Log.e("cgData.dropList: error when updating reason", e); } } @@ -3010,7 +3010,7 @@ public class cgData { } } } catch (Exception e) { - Log.e(Settings.tag, "cgData.saveLogOffline: " + e.toString()); + Log.e("cgData.saveLogOffline: " + e.toString()); } return status; @@ -3092,7 +3092,7 @@ public class cgData { return logCount.simpleQueryForLong() > 0; } } catch (Exception e) { - Log.e(Settings.tag, "cgData.hasLogOffline", e); + Log.e("cgData.hasLogOffline", e); } return false; @@ -3135,7 +3135,7 @@ public class cgData { lists.addAll(storedLists); } catch (Exception e) { - Log.e(Settings.tag, "cgData.readLists: " + e.toString()); + Log.e("cgData.readLists: " + e.toString()); } return lists; } @@ -3324,7 +3324,7 @@ public class cgData { databaseRW.delete(dbTableSearchDestionationHistory, "_id = " + destination.getId(), null); databaseRW.setTransactionSuccessful(); } catch (Exception e) { - Log.e(Settings.tag, "Unable to remove searched destination", e); + Log.e("Unable to remove searched destination", e); success = false; } finally { databaseRW.endTransaction(); @@ -3361,7 +3361,7 @@ public class cgData { } catch (SQLiteDoneException e) { // Do nothing, it only means we have no information on the cache } catch (Exception e) { - Log.e(Settings.tag, "cgData.getCacheDescription", e); + Log.e("cgData.getCacheDescription", e); } return null; diff --git a/main/src/cgeo/geocaching/cgGeo.java b/main/src/cgeo/geocaching/cgGeo.java index a8748c0..c5ab556 100644 --- a/main/src/cgeo/geocaching/cgGeo.java +++ b/main/src/cgeo/geocaching/cgGeo.java @@ -45,7 +45,7 @@ public class cgGeo { try { geoManager.requestLocationUpdates(listener.locationProvider, 0, 0, listener); } catch (Exception e) { - Log.w(Settings.tag, "There is no location provider " + listener.locationProvider); + Log.w("There is no location provider " + listener.locationProvider); } } } @@ -244,7 +244,7 @@ public class cgGeo { lastLocation.setProvider(LAST_LOCATION_PSEUDO_PROVIDER); assign(lastLocation); - Log.i(Settings.tag, "Using last location from " + provider); + Log.i("Using last location from " + provider); break; } } diff --git a/main/src/cgeo/geocaching/cgSearchHandler.java b/main/src/cgeo/geocaching/cgSearchHandler.java index 5f94d32..6d38ea1 100644 --- a/main/src/cgeo/geocaching/cgSearchHandler.java +++ b/main/src/cgeo/geocaching/cgSearchHandler.java @@ -99,7 +99,7 @@ public class cgSearchHandler extends Handler { imgHandler.sendEmptyMessage(0); } catch (IOException e) { - Log.e(Settings.tag, "Failed to download reCAPTCHA image"); + Log.e("Failed to download reCAPTCHA image"); } } } diff --git a/main/src/cgeo/geocaching/cgSearchThread.java b/main/src/cgeo/geocaching/cgSearchThread.java index 99ab685..ff73a66 100644 --- a/main/src/cgeo/geocaching/cgSearchThread.java +++ b/main/src/cgeo/geocaching/cgSearchThread.java @@ -23,7 +23,7 @@ abstract public class cgSearchThread extends Thread { try { wait(); } catch (InterruptedException e) { - Log.w(Settings.tag, "searchThread is not waiting for user..."); + Log.w("searchThread is not waiting for user..."); } } diff --git a/main/src/cgeo/geocaching/cgTrackable.java b/main/src/cgeo/geocaching/cgTrackable.java index 1e11b43..c4a3464 100644 --- a/main/src/cgeo/geocaching/cgTrackable.java +++ b/main/src/cgeo/geocaching/cgTrackable.java @@ -44,7 +44,7 @@ public class cgTrackable implements ILogable { int id = Integer.parseInt(hex, 16); return "http://geokrety.org/konkret.php?id=" + id; } catch (NumberFormatException e) { - Log.e(Settings.tag, "cgTrackable.getUrl", e); + Log.e("cgTrackable.getUrl", e); return null; } } diff --git a/main/src/cgeo/geocaching/cgeo.java b/main/src/cgeo/geocaching/cgeo.java index 7d01093..d44ad86 100644 --- a/main/src/cgeo/geocaching/cgeo.java +++ b/main/src/cgeo/geocaching/cgeo.java @@ -184,7 +184,7 @@ public class cgeo extends AbstractActivity { showToast(res.getString(reason == StatusCode.MAINTENANCE ? reason.getErrorString() : R.string.err_login_failed_toast)); } } catch (Exception e) { - Log.w(Settings.tag, "cgeo.firstLoginHander: " + e.toString()); + Log.w("cgeo.firstLoginHander: " + e.toString()); } } }; @@ -226,12 +226,12 @@ public class cgeo extends AbstractActivity { version = info.versionCode; - Log.i(Settings.tag, "Starting " + info.packageName + " " + info.versionCode + " a.k.a " + info.versionName + "..."); + Log.i("Starting " + info.packageName + " " + info.versionCode + " a.k.a " + info.versionName + "..."); info = null; manager = null; } catch (Exception e) { - Log.i(Settings.tag, "No info."); + Log.i("No info."); } try { @@ -702,7 +702,7 @@ public class cgeo extends AbstractActivity { navLocation.setText(res.getString(R.string.loc_trying)); } } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } @@ -792,7 +792,7 @@ public class cgeo extends AbstractActivity { countBubble.setVisibility(View.VISIBLE); } } catch (Exception e) { - Log.w(Settings.tag, "cgeo.countBubbleHander: " + e.toString()); + Log.w("cgeo.countBubbleHander: " + e.toString()); } } }; @@ -836,7 +836,7 @@ public class cgeo extends AbstractActivity { boolean more = false; if (version != Settings.getVersion()) { - Log.i(Settings.tag, "Initializing hard cleanup - version changed from " + Settings.getVersion() + " to " + version + "."); + Log.i("Initializing hard cleanup - version changed from " + Settings.getVersion() + " to " + version + "."); more = true; } @@ -903,7 +903,7 @@ public class cgeo extends AbstractActivity { addresses = geocoder.getFromLocation(geo.coordsNow.getLatitude(), geo.coordsNow.getLongitude(), 1); } catch (Exception e) { - Log.i(Settings.tag, "Failed to obtain address"); + Log.i("Failed to obtain address"); } obtainAddressHandler.sendEmptyMessage(0); diff --git a/main/src/cgeo/geocaching/cgeoabout.java b/main/src/cgeo/geocaching/cgeoabout.java index c1f7e83..0c812f0 100644 --- a/main/src/cgeo/geocaching/cgeoabout.java +++ b/main/src/cgeo/geocaching/cgeoabout.java @@ -37,7 +37,7 @@ public class cgeoabout extends AbstractActivity { ((TextView) findViewById(R.id.contributors)).setMovementMethod(LinkMovementMethod.getInstance()); ((TextView) findViewById(R.id.changelog)).setMovementMethod(LinkMovementMethod.getInstance()); } catch (Exception e) { - Log.e(Settings.tag, "cgeoabout.init: Failed to obtain package version."); + Log.e("cgeoabout.init: Failed to obtain package version."); } } diff --git a/main/src/cgeo/geocaching/cgeoadvsearch.java b/main/src/cgeo/geocaching/cgeoadvsearch.java index 2086c7d..62103b4 100644 --- a/main/src/cgeo/geocaching/cgeoadvsearch.java +++ b/main/src/cgeo/geocaching/cgeoadvsearch.java @@ -146,7 +146,7 @@ public class cgeoadvsearch extends AbstractActivity { } } catch (Exception e) { - Log.w(Settings.tag, "cgeoadvsearch.instantSearch: " + e.toString()); + Log.w("cgeoadvsearch.instantSearch: " + e.toString()); } return false; @@ -271,7 +271,7 @@ public class cgeoadvsearch extends AbstractActivity { } } } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } diff --git a/main/src/cgeo/geocaching/cgeoapplication.java b/main/src/cgeo/geocaching/cgeoapplication.java index 53b6ef6..9ad9c4c 100644 --- a/main/src/cgeo/geocaching/cgeoapplication.java +++ b/main/src/cgeo/geocaching/cgeoapplication.java @@ -55,14 +55,14 @@ public class cgeoapplication extends Application { @Override public void onLowMemory() { - Log.i(Settings.tag, "Cleaning applications cache."); + Log.i("Cleaning applications cache."); storage.removeAllFromCache(); } @Override public void onTerminate() { - Log.d(Settings.tag, "Terminating c:geo..."); + Log.d("Terminating c:geo..."); cleanGeo(); cleanDir(); @@ -136,7 +136,7 @@ public class cgeoapplication extends Application { public cgGeo startGeo(UpdateLocationCallback geoUpdate) { if (geo == null) { geo = new cgGeo(); - Log.i(Settings.tag, "Location service started"); + Log.i("Location service started"); } geo.replaceUpdate(geoUpdate); @@ -172,7 +172,7 @@ public class cgeoapplication extends Application { if (!geoInUse && geo != null) { cleanGeo(); - Log.i(Settings.tag, "Location service stopped"); + Log.i("Location service stopped"); } } } @@ -181,7 +181,7 @@ public class cgeoapplication extends Application { if (dir == null) { dir = new cgDirection(context, dirUpdate); - Log.i(Settings.tag, "Direction service started"); + Log.i("Direction service started"); } dir.replaceUpdate(dirUpdate); @@ -213,7 +213,7 @@ public class cgeoapplication extends Application { if (!dirInUse && dir != null) { cleanDir(); - Log.i(Settings.tag, "Direction service stopped"); + Log.i("Direction service stopped"); } } } diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java index 7d165b3..2c01c53 100644 --- a/main/src/cgeo/geocaching/cgeocaches.java +++ b/main/src/cgeo/geocaching/cgeocaches.java @@ -228,7 +228,7 @@ public class cgeocaches extends AbstractListActivity { } } catch (Exception e) { showToast(res.getString(R.string.err_detail_cache_find_any)); - Log.e(Settings.tag, "cgeocaches.loadCachesHandler: " + e.toString()); + Log.e("cgeocaches.loadCachesHandler: " + e.toString()); hideLoading(); showProgress(false); @@ -241,7 +241,7 @@ public class cgeocaches extends AbstractListActivity { hideLoading(); showProgress(false); } catch (Exception e2) { - Log.e(Settings.tag, "cgeocaches.loadCachesHandler.2: " + e2.toString()); + Log.e("cgeocaches.loadCachesHandler.2: " + e2.toString()); } if (adapter != null) { @@ -295,7 +295,7 @@ public class cgeocaches extends AbstractListActivity { } } catch (Exception e) { showToast(res.getString(R.string.err_detail_cache_find_next)); - Log.e(Settings.tag, "cgeocaches.loadNextPageHandler: " + e.toString()); + Log.e("cgeocaches.loadNextPageHandler: " + e.toString()); } hideLoading(); @@ -625,7 +625,7 @@ public class cgeocaches extends AbstractListActivity { default: title = "caches"; setTitle(title); - Log.e(Settings.tag, "cgeocaches.onCreate: No action or unknown action specified"); + Log.e("cgeocaches.onCreate: No action or unknown action specified"); break; } prepareFilterBar(); @@ -900,7 +900,7 @@ public class cgeocaches extends AbstractListActivity { item.setTitle(res.getString(R.string.export)); } } catch (Exception e) { - Log.e(Settings.tag, "cgeocaches.onPrepareOptionsMenu: " + e.toString()); + Log.e("cgeocaches.onPrepareOptionsMenu: " + e.toString()); } return true; @@ -1071,7 +1071,7 @@ public class cgeocaches extends AbstractListActivity { try { adapterInfo = (AdapterContextMenuInfo) info; } catch (Exception e) { - Log.w(Settings.tag, "cgeocaches.onCreateContextMenu: " + e.toString()); + Log.w("cgeocaches.onCreateContextMenu: " + e.toString()); } if (adapterInfo == null || adapterInfo.position >= adapter.getCount()) { @@ -1149,7 +1149,7 @@ public class cgeocaches extends AbstractListActivity { try { adapterInfo = (AdapterContextMenuInfo) info; } catch (Exception e) { - Log.w(Settings.tag, "cgeocaches.onContextItemSelected: " + e.toString()); + Log.w("cgeocaches.onContextItemSelected: " + e.toString()); } if (id == MENU_DEFAULT_NAVIGATION) { @@ -1548,7 +1548,7 @@ public class cgeocaches extends AbstractListActivity { } } } catch (Exception e) { - Log.w(Settings.tag, "Failed to UpdateLocation location."); + Log.w("Failed to UpdateLocation location."); } } } @@ -1773,7 +1773,7 @@ public class cgeocaches extends AbstractListActivity { try { if (needToStop) { - Log.i(Settings.tag, "Stopped storing process."); + Log.i("Stopped storing process."); break; } @@ -1784,15 +1784,15 @@ public class cgeocaches extends AbstractListActivity { delay = 500; } - Log.i(Settings.tag, "Waiting for next cache " + delay + " ms"); + Log.i("Waiting for next cache " + delay + " ms"); sleep(delay); } catch (Exception e) { - Log.e(Settings.tag, "cgeocaches.LoadDetailsThread.sleep: " + e.toString()); + Log.e("cgeocaches.LoadDetailsThread.sleep: " + e.toString()); } } if (needToStop) { - Log.i(Settings.tag, "Stopped storing process."); + Log.i("Stopped storing process."); break; } @@ -1803,7 +1803,7 @@ public class cgeocaches extends AbstractListActivity { yield(); } catch (Exception e) { - Log.e(Settings.tag, "cgeocaches.LoadDetailsThread: " + e.toString()); + Log.e("cgeocaches.LoadDetailsThread: " + e.toString()); } last = System.currentTimeMillis(); @@ -1893,7 +1893,7 @@ public class cgeocaches extends AbstractListActivity { times = 0; } } catch (InterruptedException e) { - Log.e(Settings.tag, "cgeocaches.LoadFromWebThread.sleep: " + e.toString()); + Log.e("cgeocaches.LoadFromWebThread.sleep: " + e.toString()); } } @@ -1933,13 +1933,13 @@ public class cgeocaches extends AbstractListActivity { try { if (needToStop) { - Log.i(Settings.tag, "Stopped dropping process."); + Log.i("Stopped dropping process."); break; } app.markDropped(cache.getGeocode()); } catch (Exception e) { - Log.e(Settings.tag, "cgeocaches.DropDetailsThread: " + e.toString()); + Log.e("cgeocaches.DropDetailsThread: " + e.toString()); } } cacheListTemp.clear(); @@ -1980,7 +1980,7 @@ public class cgeocaches extends AbstractListActivity { try { if (needToStop) { - Log.i(Settings.tag, "Stopped removing process."); + Log.i("Stopped removing process."); break; } @@ -1991,7 +1991,7 @@ public class cgeocaches extends AbstractListActivity { yield(); } catch (Exception e) { - Log.e(Settings.tag, "cgeocaches.RemoveFromHistoryThread: " + e.toString()); + Log.e("cgeocaches.RemoveFromHistoryThread: " + e.toString()); } } diff --git a/main/src/cgeo/geocaching/cgeoimages.java b/main/src/cgeo/geocaching/cgeoimages.java index 6f12bed..bac0cad 100644 --- a/main/src/cgeo/geocaching/cgeoimages.java +++ b/main/src/cgeo/geocaching/cgeoimages.java @@ -207,7 +207,7 @@ public class cgeoimages extends AbstractActivity { image.getBitmap().compress(CompressFormat.JPEG, 100, fos); fos.close(); } catch (Exception e) { - Log.e(Settings.tag, "cgeoimages.handleMessage.onClick: " + e.toString()); + Log.e("cgeoimages.handleMessage.onClick: " + e.toString()); return; } diff --git a/main/src/cgeo/geocaching/cgeoinit.java b/main/src/cgeo/geocaching/cgeoinit.java index cb5808f..c4c16d5 100644 --- a/main/src/cgeo/geocaching/cgeoinit.java +++ b/main/src/cgeo/geocaching/cgeoinit.java @@ -73,7 +73,7 @@ public class cgeoinit extends AbstractActivity { } catch (Exception e) { showToast(res.getString(R.string.err_login_failed)); - Log.e(Settings.tag, "cgeoinit.logInHandler: " + e.toString()); + Log.e("cgeoinit.logInHandler: " + e.toString()); } if (loginDialog != null && loginDialog.isShowing()) { @@ -101,7 +101,7 @@ public class cgeoinit extends AbstractActivity { } catch (Exception e) { showToast(res.getString(R.string.init_sendToCgeo_register_fail)); - Log.e(Settings.tag, "cgeoinit.webHandler: " + e.toString()); + Log.e("cgeoinit.webHandler: " + e.toString()); } if (webDialog != null && webDialog.isShowing()) { @@ -872,7 +872,7 @@ public class cgeoinit extends AbstractActivity { try { pin = Integer.parseInt(strings[1].trim()); } catch (Exception e) { - Log.e(Settings.tag, "webDialog: " + e.toString()); + Log.e("webDialog: " + e.toString()); } String code = strings[0]; Settings.setWebNameCode(nam, code); diff --git a/main/src/cgeo/geocaching/cgeonavigate.java b/main/src/cgeo/geocaching/cgeonavigate.java index 0cbd30f..d7ef655 100644 --- a/main/src/cgeo/geocaching/cgeonavigate.java +++ b/main/src/cgeo/geocaching/cgeonavigate.java @@ -271,7 +271,7 @@ public class cgeonavigate extends AbstractActivity { setDestCoords(); updateDistanceInfo(); - Log.d(Settings.tag, "destination set: " + title + " (" + dstCoords + ")"); + Log.d("destination set: " + title + " (" + dstCoords + ")"); return true; } @@ -367,7 +367,7 @@ public class cgeonavigate extends AbstractActivity { northHeading = geo.bearingNow; } } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } diff --git a/main/src/cgeo/geocaching/cgeopoint.java b/main/src/cgeo/geocaching/cgeopoint.java index 6242952..3f01f74 100644 --- a/main/src/cgeo/geocaching/cgeopoint.java +++ b/main/src/cgeo/geocaching/cgeopoint.java @@ -498,7 +498,7 @@ public class cgeopoint extends AbstractActivity { latButton.setHint(geo.coordsNow.format(GeopointFormatter.Format.LAT_DECMINUTE_RAW)); lonButton.setHint(geo.coordsNow.format(GeopointFormatter.Format.LON_DECMINUTE_RAW)); } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } diff --git a/main/src/cgeo/geocaching/cgeopopup.java b/main/src/cgeo/geocaching/cgeopopup.java index 8ad07bb..48f70c2 100644 --- a/main/src/cgeo/geocaching/cgeopopup.java +++ b/main/src/cgeo/geocaching/cgeopopup.java @@ -74,7 +74,7 @@ public class cgeopopup extends AbstractActivity { } catch (Exception e) { showToast(res.getString(R.string.err_store)); - Log.e(Settings.tag, "cgeopopup.storeCacheHandler: " + e.toString()); + Log.e("cgeopopup.storeCacheHandler: " + e.toString()); } if (storeDialog != null) { @@ -97,7 +97,7 @@ public class cgeopopup extends AbstractActivity { } catch (Exception e) { showToast(res.getString(R.string.err_drop)); - Log.e(Settings.tag, "cgeopopup.dropCacheHandler: " + e.toString()); + Log.e("cgeopopup.dropCacheHandler: " + e.toString()); } if (dropDialog != null) { @@ -452,7 +452,7 @@ public class cgeopopup extends AbstractActivity { offlineStore.setOnClickListener(new storeCache()); } } catch (Exception e) { - Log.e(Settings.tag, "cgeopopup.init: " + e.toString()); + Log.e("cgeopopup.init: " + e.toString()); } if (geo != null) { @@ -515,7 +515,7 @@ public class cgeopopup extends AbstractActivity { cacheDistance.bringToFront(); } } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } diff --git a/main/src/cgeo/geocaching/cgeotouch.java b/main/src/cgeo/geocaching/cgeotouch.java index 09857a2..3c757db 100644 --- a/main/src/cgeo/geocaching/cgeotouch.java +++ b/main/src/cgeo/geocaching/cgeotouch.java @@ -408,7 +408,7 @@ public class cgeotouch extends AbstractActivity implements DateDialog.DateDialog loadDataHandler.obtainMessage(MSG_UPDATE_TYPE, typeSelected).sendToTarget(); } } catch (Exception e) { - Log.e(Settings.tag, "cgeotouch.loadData.run: " + e.toString()); + Log.e("cgeotouch.loadData.run: " + e.toString()); } loadDataHandler.sendEmptyMessage(0); @@ -452,7 +452,7 @@ public class cgeotouch extends AbstractActivity implements DateDialog.DateDialog return status; } catch (Exception e) { - Log.e(Settings.tag, "cgeotouch.postLogFn: " + e.toString()); + Log.e("cgeotouch.postLogFn: " + e.toString()); } return StatusCode.LOG_POST_ERROR; diff --git a/main/src/cgeo/geocaching/cgeotrackable.java b/main/src/cgeo/geocaching/cgeotrackable.java index 7b310ed..8306217 100644 --- a/main/src/cgeo/geocaching/cgeotrackable.java +++ b/main/src/cgeo/geocaching/cgeotrackable.java @@ -221,7 +221,7 @@ public class cgeotrackable extends AbstractActivity { Message message = handler.obtainMessage(0, image); handler.sendMessage(message); } catch (Exception e) { - Log.e(Settings.tag, "cgeospoilers.onCreate.onClick.run: " + e.toString()); + Log.e("cgeospoilers.onCreate.onClick.run: " + e.toString()); } } }.start(); @@ -229,7 +229,7 @@ public class cgeotrackable extends AbstractActivity { imgView.addView(trackableImage); } } catch (Exception e) { - Log.e(Settings.tag, "cgeotrackable.loadTrackableHandler: " + e.toString() + Arrays.toString(e.getStackTrace())); + Log.e("cgeotrackable.loadTrackableHandler: " + e.toString() + Arrays.toString(e.getStackTrace())); } displayLogs(); @@ -525,7 +525,7 @@ public class cgeotrackable extends AbstractActivity { registerForContextMenu(view); openContextMenu(view); } catch (Exception e) { - Log.e(Settings.tag, "cgeotrackable.userActions.onClick ", e); + Log.e("cgeotrackable.userActions.onClick ", e); } } } @@ -573,7 +573,7 @@ public class cgeotrackable extends AbstractActivity { Message message = handler.obtainMessage(0, image); handler.sendMessage(message); } catch (Exception e) { - Log.e(Settings.tag, "cgeotrackable.tbIconThread.run: " + e.toString()); + Log.e("cgeotrackable.tbIconThread.run: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/cgeowaypoint.java b/main/src/cgeo/geocaching/cgeowaypoint.java index 89450ec..940d61d 100644 --- a/main/src/cgeo/geocaching/cgeowaypoint.java +++ b/main/src/cgeo/geocaching/cgeowaypoint.java @@ -111,7 +111,7 @@ public class cgeowaypoint extends AbstractActivity { waitDialog.dismiss(); waitDialog = null; } - Log.e(Settings.tag, "cgeowaypoint.loadWaypointHandler: " + e.toString()); + Log.e("cgeowaypoint.loadWaypointHandler: " + e.toString()); } } @@ -295,7 +295,7 @@ public class cgeowaypoint extends AbstractActivity { loadWaypointHandler.sendMessage(Message.obtain()); } catch (Exception e) { - Log.e(Settings.tag, "cgeowaypoint.loadWaypoint.run: " + e.toString()); + Log.e("cgeowaypoint.loadWaypoint.run: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/cgeowaypointadd.java b/main/src/cgeo/geocaching/cgeowaypointadd.java index 28d9934..aece2bf 100644 --- a/main/src/cgeo/geocaching/cgeowaypointadd.java +++ b/main/src/cgeo/geocaching/cgeowaypointadd.java @@ -87,7 +87,7 @@ public class cgeowaypointadd extends AbstractActivity { initializeDistanceUnitSelector(); } catch (Exception e) { - Log.e(Settings.tag, "cgeowaypointadd.loadWaypointHandler: " + e.toString()); + Log.e("cgeowaypointadd.loadWaypointHandler: " + e.toString()); } finally { if (waitDialog != null) { waitDialog.dismiss(); @@ -251,7 +251,7 @@ public class cgeowaypointadd extends AbstractActivity { @Override public void updateLocation(cgGeo geo) { - Log.d(Settings.tag, "cgeowaypointadd.updateLocation called"); + Log.d("cgeowaypointadd.updateLocation called"); if (geo == null || geo.coordsNow == null) { return; } @@ -262,7 +262,7 @@ public class cgeowaypointadd extends AbstractActivity { bLat.setHint(geo.coordsNow.format(GeopointFormatter.Format.LAT_DECMINUTE_RAW)); bLon.setHint(geo.coordsNow.format(GeopointFormatter.Format.LON_DECMINUTE_RAW)); } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } @@ -276,7 +276,7 @@ public class cgeowaypointadd extends AbstractActivity { loadWaypointHandler.sendMessage(Message.obtain()); } catch (Exception e) { - Log.e(Settings.tag, "cgeowaypoint.loadWaypoint.run: " + e.toString()); + Log.e("cgeowaypoint.loadWaypoint.run: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/compatibility/AndroidLevel8.java b/main/src/cgeo/geocaching/compatibility/AndroidLevel8.java index 72058cd..0fc9624 100644 --- a/main/src/cgeo/geocaching/compatibility/AndroidLevel8.java +++ b/main/src/cgeo/geocaching/compatibility/AndroidLevel8.java @@ -1,6 +1,5 @@ package cgeo.geocaching.compatibility; -import cgeo.geocaching.Settings; import cgeo.geocaching.utils.Log; import android.app.Activity; @@ -15,7 +14,7 @@ public class AndroidLevel8 implements AndroidLevel8Interface { } public void dataChanged(final String name) { - Log.i(Settings.tag, "Requesting settings backup with settings manager"); + Log.i("Requesting settings backup with settings manager"); BackupManager.dataChanged(name); } } diff --git a/main/src/cgeo/geocaching/compatibility/Compatibility.java b/main/src/cgeo/geocaching/compatibility/Compatibility.java index bfc491e..6086604 100644 --- a/main/src/cgeo/geocaching/compatibility/Compatibility.java +++ b/main/src/cgeo/geocaching/compatibility/Compatibility.java @@ -1,6 +1,5 @@ package cgeo.geocaching.compatibility; -import cgeo.geocaching.Settings; import cgeo.geocaching.activity.AbstractActivity; import cgeo.geocaching.utils.Log; @@ -54,7 +53,7 @@ public final class Compatibility { } } catch (final Exception e) { // This should never happen: IllegalArgumentException, IllegalAccessException or InvocationTargetException - Log.e(Settings.tag, "Cannot call getRotation()", e); + Log.e("Cannot call getRotation()", e); } } else { final Display display = activity.getWindowManager() @@ -95,7 +94,7 @@ public final class Compatibility { try { MethodUtils.invokeMethod(activity, "overridePendingTransition", enterAnim, exitAnim); } catch (Exception e) { - Log.e(Settings.tag, "cannot call overridePendingTransition", e); + Log.e("cannot call overridePendingTransition", e); } } diff --git a/main/src/cgeo/geocaching/connector/gc/GCBase.java b/main/src/cgeo/geocaching/connector/gc/GCBase.java index 3ecd31a..9d5ee3e 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCBase.java +++ b/main/src/cgeo/geocaching/connector/gc/GCBase.java @@ -113,7 +113,7 @@ public class GCBase { * @return */ private static SearchResult searchByViewport(final Viewport viewport, final String[] tokens, Strategy strategy) { - Log.d(Settings.tag, "GCBase.searchByViewport" + viewport.toString()); + Log.d("GCBase.searchByViewport" + viewport.toString()); String referer = GCConstants.URL_LIVE_MAP; @@ -166,11 +166,11 @@ public class GCBase { String data = Tile.requestMapInfo(GCConstants.URL_MAP_INFO + urlString, referer); if (StringUtils.isEmpty(data)) { - Log.e(Settings.tag, "GCBase.searchByViewport: No data from server for tile (" + tile.getX() + "/" + tile.getY() + ")"); + Log.e("GCBase.searchByViewport: No data from server for tile (" + tile.getX() + "/" + tile.getY() + ")"); } else { final SearchResult search = parseMapJSON(data, tile, bitmap, strategy); if (search == null || CollectionUtils.isEmpty(search.getGeocodes())) { - Log.e(Settings.tag, "GCBase.searchByViewport: No cache parsed for viewport " + viewport); + Log.e("GCBase.searchByViewport: No cache parsed for viewport " + viewport); } else { searchResult.addGeocodes(search.getGeocodes()); @@ -308,10 +308,10 @@ public class GCBase { } searchResult.addCache(cache); } - Log.d(Settings.tag, "Retrieved " + searchResult.getCount() + " caches for tile " + tile.toString()); + Log.d("Retrieved " + searchResult.getCount() + " caches for tile " + tile.toString()); } catch (Exception e) { - Log.e(Settings.tag, "GCBase.parseMapJSON", e); + Log.e("GCBase.parseMapJSON", e); } return searchResult; diff --git a/main/src/cgeo/geocaching/connector/gc/GCConnector.java b/main/src/cgeo/geocaching/connector/gc/GCConnector.java index d955418..4794654 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCConnector.java +++ b/main/src/cgeo/geocaching/connector/gc/GCConnector.java @@ -90,7 +90,7 @@ public class GCConnector extends AbstractConnector { public SearchResult searchByGeocode(final String geocode, final String guid, final cgeoapplication app, final CancellableHandler handler) { if (app == null) { - Log.e(Settings.tag, "cgeoBase.searchByGeocode: No application found"); + Log.e("cgeoBase.searchByGeocode: No application found"); return null; } @@ -111,7 +111,7 @@ public class GCConnector extends AbstractConnector { final SearchResult search = new SearchResult(); if (app.isThere(geocode, guid, true, false)) { if (StringUtils.isBlank(geocode) && StringUtils.isNotBlank(guid)) { - Log.i(Settings.tag, "Loading old cache from cache."); + Log.i("Loading old cache from cache."); search.addGeocode(app.getGeocode(guid)); } else { @@ -121,7 +121,7 @@ public class GCConnector extends AbstractConnector { return search; } - Log.e(Settings.tag, "cgeoBase.searchByGeocode: No data from server"); + Log.e("cgeoBase.searchByGeocode: No data from server"); search.setError(StatusCode.COMMUNICATION_ERROR); return search; } @@ -129,7 +129,7 @@ public class GCConnector extends AbstractConnector { final SearchResult searchResult = cgBase.parseCache(page, handler); if (searchResult == null || CollectionUtils.isEmpty(searchResult.getGeocodes())) { - Log.e(Settings.tag, "cgeoBase.searchByGeocode: No cache parsed"); + Log.e("cgeoBase.searchByGeocode: No cache parsed"); return searchResult; } diff --git a/main/src/cgeo/geocaching/connector/gc/Tile.java b/main/src/cgeo/geocaching/connector/gc/Tile.java index 27b45de..fd51839 100644 --- a/main/src/cgeo/geocaching/connector/gc/Tile.java +++ b/main/src/cgeo/geocaching/connector/gc/Tile.java @@ -1,6 +1,5 @@ package cgeo.geocaching.connector.gc; -import cgeo.geocaching.Settings; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.geopoint.Viewport; import cgeo.geocaching.network.Network; @@ -226,7 +225,7 @@ public class Tile { try { return response != null ? BitmapFactory.decodeStream(response.getEntity().getContent()) : null; } catch (IOException e) { - Log.e(Settings.tag, "cgBase.requestMapTile() " + e.getMessage()); + Log.e("cgBase.requestMapTile() " + e.getMessage()); } return null; } diff --git a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java index 7c1138a..80786f9 100644 --- a/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java +++ b/main/src/cgeo/geocaching/connector/opencaching/OkapiClient.java @@ -1,6 +1,5 @@ package cgeo.geocaching.connector.opencaching; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgImage; import cgeo.geocaching.cgLog; @@ -114,7 +113,7 @@ final public class OkapiClient { return caches; } } catch (JSONException e) { - Log.e(Settings.tag, "OkapiClient.parseCaches", e); + Log.e("OkapiClient.parseCaches", e); } return null; } @@ -181,7 +180,7 @@ final public class OkapiClient { // save full detailed caches cgeoapplication.getInstance().saveCache(cache, EnumSet.of(SaveFlag.SAVE_DB)); } catch (JSONException e) { - Log.e(Settings.tag, "OkapiClient.parseCache", e); + Log.e("OkapiClient.parseCache", e); } return cache; } @@ -218,7 +217,7 @@ final public class OkapiClient { } result.add(log); } catch (JSONException e) { - Log.e(Settings.tag, "OkapiClient.parseLogs", e); + Log.e("OkapiClient.parseLogs", e); } } return result; @@ -240,7 +239,7 @@ final public class OkapiClient { try { return ISO8601DATEFORMAT.parse(strippedDate); } catch (ParseException e) { - Log.e(Settings.tag, "OkapiClient.parseDate", e); + Log.e("OkapiClient.parseDate", e); } return null; } @@ -260,7 +259,7 @@ final public class OkapiClient { try { size = response.getDouble(CACHE_SIZE); } catch (JSONException e) { - Log.e(Settings.tag, "OkapiClient.getCacheSize", e); + Log.e("OkapiClient.getCacheSize", e); } switch ((int) Math.round(size)) { case 1: diff --git a/main/src/cgeo/geocaching/export/FieldnoteExport.java b/main/src/cgeo/geocaching/export/FieldnoteExport.java index 4edc367..9e6ae1e 100644 --- a/main/src/cgeo/geocaching/export/FieldnoteExport.java +++ b/main/src/cgeo/geocaching/export/FieldnoteExport.java @@ -1,7 +1,6 @@ package cgeo.geocaching.export; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgLog; import cgeo.geocaching.cgeoapplication; @@ -159,7 +158,7 @@ public class FieldnoteExport extends AbstractExport { } publishProgress(i + 1); } catch (Exception e) { - Log.e(Settings.tag, "FieldnoteExport.ExportTask generation", e); + Log.e("FieldnoteExport.ExportTask generation", e); return false; } } @@ -179,14 +178,14 @@ public class FieldnoteExport extends AbstractExport { fw = new OutputStreamWriter(os, "ISO-8859-1"); // TODO: gc.com doesn't support UTF-8 fw.write(fieldNoteBuffer.toString()); } catch (IOException e) { - Log.e(Settings.tag, "FieldnoteExport.ExportTask export", e); + Log.e("FieldnoteExport.ExportTask export", e); return false; } finally { if (fw != null) { try { fw.close(); } catch (IOException e) { - Log.e(Settings.tag, "FieldnoteExport.ExportTask export", e); + Log.e("FieldnoteExport.ExportTask export", e); return false; } } diff --git a/main/src/cgeo/geocaching/export/GpxExport.java b/main/src/cgeo/geocaching/export/GpxExport.java index ac4c336..da46ab4 100644 --- a/main/src/cgeo/geocaching/export/GpxExport.java +++ b/main/src/cgeo/geocaching/export/GpxExport.java @@ -1,7 +1,6 @@ package cgeo.geocaching.export; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgLog; import cgeo.geocaching.cgeoapplication; @@ -242,7 +241,7 @@ public class GpxExport extends AbstractExport { publishProgress(i + 1); } } catch (Exception e) { - Log.e(Settings.tag, "GpxExport.ExportTask generation", e); + Log.e("GpxExport.ExportTask generation", e); return false; } @@ -261,14 +260,14 @@ public class GpxExport extends AbstractExport { fw = new OutputStreamWriter(os, "UTF-8"); fw.write(gpx.toString()); } catch (IOException e) { - Log.e(Settings.tag, "GpxExport.ExportTask export", e); + Log.e("GpxExport.ExportTask export", e); return false; } finally { if (fw != null) { try { fw.close(); } catch (IOException e) { - Log.e(Settings.tag, "GpxExport.ExportTask export", e); + Log.e("GpxExport.ExportTask export", e); return false; } } diff --git a/main/src/cgeo/geocaching/files/FileList.java b/main/src/cgeo/geocaching/files/FileList.java index dbdea60..576aa2c 100644 --- a/main/src/cgeo/geocaching/files/FileList.java +++ b/main/src/cgeo/geocaching/files/FileList.java @@ -1,7 +1,6 @@ package cgeo.geocaching.files; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.StoredList; import cgeo.geocaching.activity.AbstractListActivity; import cgeo.geocaching.utils.Log; @@ -87,7 +86,7 @@ public abstract class FileList<T extends ArrayAdapter<File>> extends AbstractLis if (waitDialog != null) { waitDialog.dismiss(); } - Log.e(Settings.tag, "cgFileList.loadFilesHandler: " + e.toString()); + Log.e("cgFileList.loadFilesHandler: " + e.toString()); } } }; @@ -188,10 +187,10 @@ public abstract class FileList<T extends ArrayAdapter<File>> extends AbstractLis listDir(list, Environment.getExternalStorageDirectory()); } } else { - Log.w(Settings.tag, "No external media mounted."); + Log.w("No external media mounted."); } } catch (Exception e) { - Log.e(Settings.tag, "cgFileList.loadFiles.run: " + e.toString()); + Log.e("cgFileList.loadFiles.run: " + e.toString()); } changeWaitDialogHandler.sendMessage(Message.obtain(changeWaitDialogHandler, 0, "loaded directories")); diff --git a/main/src/cgeo/geocaching/files/GPXImporter.java b/main/src/cgeo/geocaching/files/GPXImporter.java index 8fd099d..ccb71cd 100644 --- a/main/src/cgeo/geocaching/files/GPXImporter.java +++ b/main/src/cgeo/geocaching/files/GPXImporter.java @@ -112,7 +112,7 @@ public class GPXImporter { }
}
- Log.i(Settings.tag, "importGPX: " + uri + ", mimetype=" + mimeType);
+ Log.i("importGPX: " + uri + ", mimetype=" + mimeType);
if (GPX_MIME_TYPES.contains(mimeType)) {
new ImportGpxAttachmentThread(uri, contentResolver, listId, importStepHandler, progressHandler).start();
} else if (ZIP_MIME_TYPES.contains(mimeType)) {
@@ -142,7 +142,7 @@ public class GPXImporter { importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_STORE_CACHES, R.string.gpx_import_storing, caches.size()));
SearchResult search = storeParsedCaches(caches);
- Log.i(Settings.tag, "Imported successfully " + caches.size() + " caches.");
+ Log.i("Imported successfully " + caches.size() + " caches.");
if (Settings.isStoreOfflineMaps() || Settings.isStoreOfflineWpMaps()) {
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_STORE_STATIC_MAPS, R.string.gpx_import_store_static_maps, search.getCount()));
@@ -155,16 +155,16 @@ public class GPXImporter { importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_FINISHED, search.getCount(), 0, search));
} catch (IOException e) {
- Log.i(Settings.tag, "Importing caches failed - error reading data: " + e.getMessage());
+ Log.i("Importing caches failed - error reading data: " + e.getMessage());
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_FINISHED_WITH_ERROR, R.string.gpx_import_error_io, 0, e.getLocalizedMessage()));
} catch (ParserException e) {
- Log.i(Settings.tag, "Importing caches failed - data format error" + e.getMessage());
+ Log.i("Importing caches failed - data format error" + e.getMessage());
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_FINISHED_WITH_ERROR, R.string.gpx_import_error_parser, 0, e.getLocalizedMessage()));
} catch (CancellationException e) {
- Log.i(Settings.tag, "Importing caches canceled");
+ Log.i("Importing caches canceled");
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_CANCELED));
} catch (Exception e) {
- Log.e(Settings.tag, "Importing caches failed - unknown error: ", e);
+ Log.e("Importing caches failed - unknown error: ", e);
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_FINISHED_WITH_ERROR, R.string.gpx_import_error_unexpected, 0, e.getLocalizedMessage()));
}
}
@@ -194,7 +194,7 @@ public class GPXImporter { int storedCacheMaps = 0;
for (String geocode : importedCaches.getGeocodes()) {
cgCache cache = app.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS);
- Log.d(Settings.tag, "GPXImporter.ImportThread.importStaticMaps start downloadMaps for cache " + geocode);
+ Log.d("GPXImporter.ImportThread.importStaticMaps start downloadMaps for cache " + geocode);
StaticMapsProvider.downloadMaps(cache, app);
storedCacheMaps++;
if (progressHandler.isCancelled()) {
@@ -216,7 +216,7 @@ public class GPXImporter { @Override
protected Collection<cgCache> doImport() throws IOException, ParserException {
- Log.i(Settings.tag, "Import LOC file: " + file.getAbsolutePath());
+ Log.i("Import LOC file: " + file.getAbsolutePath());
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_READ_FILE, R.string.gpx_import_loading_caches, (int) file.length()));
LocParser parser = new LocParser(listId);
return parser.parse(file, progressHandler);
@@ -253,7 +253,7 @@ public class GPXImporter { @Override
protected Collection<cgCache> doImport(GPXParser parser) throws IOException, ParserException {
- Log.i(Settings.tag, "Import GPX file: " + cacheFile.getAbsolutePath());
+ Log.i("Import GPX file: " + cacheFile.getAbsolutePath());
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_READ_FILE, R.string.gpx_import_loading_caches, (int) cacheFile.length()));
Collection<cgCache> caches = parser.parse(cacheFile, progressHandler);
@@ -261,7 +261,7 @@ public class GPXImporter { if (wptsFilename != null) {
final File wptsFile = new File(cacheFile.getParentFile(), wptsFilename);
if (wptsFile.canRead()) {
- Log.i(Settings.tag, "Import GPX waypoint file: " + wptsFile.getAbsolutePath());
+ Log.i("Import GPX waypoint file: " + wptsFile.getAbsolutePath());
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_READ_WPT_FILE, R.string.gpx_import_loading_waypoints, (int) wptsFile.length()));
caches = parser.parse(wptsFile, progressHandler);
}
@@ -282,7 +282,7 @@ public class GPXImporter { @Override
protected Collection<cgCache> doImport(GPXParser parser) throws IOException, ParserException {
- Log.i(Settings.tag, "Import GPX from uri: " + uri);
+ Log.i("Import GPX from uri: " + uri);
importStepHandler.sendMessage(importStepHandler.obtainMessage(IMPORT_STEP_READ_FILE, R.string.gpx_import_loading_caches, -1));
InputStream is = contentResolver.openInputStream(uri);
try {
@@ -347,7 +347,7 @@ public class GPXImporter { public ImportGpxZipFileThread(final File file, int listId, Handler importStepHandler, CancellableHandler progressHandler) {
super(listId, importStepHandler, progressHandler);
this.cacheFile = file;
- Log.i(Settings.tag, "Import zipped GPX: " + file);
+ Log.i("Import zipped GPX: " + file);
}
@Override
@@ -364,7 +364,7 @@ public class GPXImporter { super(listId, importStepHandler, progressHandler);
this.uri = uri;
this.contentResolver = contentResolver;
- Log.i(Settings.tag, "Import zipped GPX from uri: " + uri);
+ Log.i("Import zipped GPX from uri: " + uri);
}
@Override
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java index 0a8137e..1706964 100644 --- a/main/src/cgeo/geocaching/files/GPXParser.java +++ b/main/src/cgeo/geocaching/files/GPXParser.java @@ -1,7 +1,6 @@ package cgeo.geocaching.files; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.StoredList; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgLog; @@ -259,7 +258,7 @@ public abstract class GPXParser extends FileParser { Double.valueOf(attrs.getValue("lon")))); } } catch (Exception e) { - Log.w(Settings.tag, "Failed to parse waypoint's latitude and/or longitude."); + Log.w("Failed to parse waypoint's latitude and/or longitude."); } } }); @@ -295,7 +294,7 @@ public abstract class GPXParser extends FileParser { final String key = cache.getGeocode(); if (result.containsKey(key)) { - Log.w(Settings.tag, "Duplicate geocode during GPX import: " + key); + Log.w("Duplicate geocode during GPX import: " + key); } result.put(key, cache); showProgressMessage(progressHandler, progressStream.getProgress()); @@ -346,7 +345,7 @@ public abstract class GPXParser extends FileParser { try { cache.setHidden(parseDate(body)); } catch (Exception e) { - Log.w(Settings.tag, "Failed to parse cache date: " + e.toString()); + Log.w("Failed to parse cache date: " + e.toString()); } } }); @@ -468,7 +467,7 @@ public abstract class GPXParser extends FileParser { cache.setDisabled(!attrs.getValue("available").equalsIgnoreCase("true")); } } catch (Exception e) { - Log.w(Settings.tag, "Failed to parse cache attributes."); + Log.w("Failed to parse cache attributes."); } } }); @@ -548,7 +547,7 @@ public abstract class GPXParser extends FileParser { try { cache.setDifficulty(Float.parseFloat(body)); } catch (NumberFormatException e) { - Log.w(Settings.tag, "Failed to parse difficulty: " + e.toString()); + Log.w("Failed to parse difficulty: " + e.toString()); } } }); @@ -561,7 +560,7 @@ public abstract class GPXParser extends FileParser { try { cache.setTerrain(Float.parseFloat(body)); } catch (NumberFormatException e) { - Log.w(Settings.tag, "Failed to parse terrain: " + e.toString()); + Log.w("Failed to parse terrain: " + e.toString()); } } }); @@ -705,7 +704,7 @@ public abstract class GPXParser extends FileParser { try { log.date = parseDate(body).getTime(); } catch (Exception e) { - Log.w(Settings.tag, "Failed to parse log date: " + e.toString()); + Log.w("Failed to parse log date: " + e.toString()); } } }); @@ -744,7 +743,7 @@ public abstract class GPXParser extends FileParser { Xml.parse(progressStream, Xml.Encoding.UTF_8, root.getContentHandler()); return result.values(); } catch (SAXException e) { - Log.e(Settings.tag, "Cannot parse .gpx file as GPX " + version + ": could not parse XML - " + e.toString()); + Log.e("Cannot parse .gpx file as GPX " + version + ": could not parse XML - " + e.toString()); throw new ParserException("Cannot parse .gpx file as GPX " + version + ": could not parse XML", e); } } diff --git a/main/src/cgeo/geocaching/files/LocParser.java b/main/src/cgeo/geocaching/files/LocParser.java index 3be8da4..ad44dc4 100644 --- a/main/src/cgeo/geocaching/files/LocParser.java +++ b/main/src/cgeo/geocaching/files/LocParser.java @@ -1,7 +1,6 @@ package cgeo.geocaching.files; import cgeo.geocaching.SearchResult; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.enumerations.CacheSize; @@ -103,8 +102,7 @@ public final class LocParser extends FileParser { } } - Log.i(Settings.tag, - "Coordinates found in .loc file: " + coords.size()); + Log.i("Coordinates found in .loc file: " + coords.size()); return coords; } @@ -113,7 +111,7 @@ public final class LocParser extends FileParser { try { return new Geopoint(Double.valueOf(latitude), Double.valueOf(longitude)); } catch (NumberFormatException e) { - Log.e(Settings.tag, "LOC format has changed"); + Log.e("LOC format has changed"); } // fall back to parser, just in case the format changes return GeopointParser.parse(latitude, longitude); @@ -144,7 +142,7 @@ public final class LocParser extends FileParser { cache.setListId(listId); cache.setDetailed(true); } - Log.i(Settings.tag, "Caches found in .loc file: " + caches.size()); + Log.i("Caches found in .loc file: " + caches.size()); return caches; } diff --git a/main/src/cgeo/geocaching/files/LocalStorage.java b/main/src/cgeo/geocaching/files/LocalStorage.java index a97c176..f37d22f 100644 --- a/main/src/cgeo/geocaching/files/LocalStorage.java +++ b/main/src/cgeo/geocaching/files/LocalStorage.java @@ -1,6 +1,5 @@ package cgeo.geocaching.files; -import cgeo.geocaching.Settings; import cgeo.geocaching.utils.CryptUtils; import cgeo.geocaching.utils.Log; @@ -159,7 +158,7 @@ public class LocalStorage { saveHeader("last-modified", response, targetFile); return saved; } catch (IOException e) { - Log.e(Settings.tag, "LocalStorage.saveEntityToFile", e); + Log.e("LocalStorage.saveEntityToFile", e); } return false; @@ -203,7 +202,7 @@ public class LocalStorage { } catch (final FileNotFoundException e) { // Do nothing, the file does not exist } catch (final Exception e) { - Log.w(Settings.tag, "could not read saved header " + name + " for " + baseFile, e); + Log.w("could not read saved header " + name + " for " + baseFile, e); } return null; } @@ -234,7 +233,7 @@ public class LocalStorage { inputStream.close(); } } catch (IOException e) { - Log.e(Settings.tag, "LocalStorage.saveToFile", e); + Log.e("LocalStorage.saveToFile", e); } return false; } @@ -257,7 +256,7 @@ public class LocalStorage { input = new FileInputStream(source); output = new FileOutputStream(destination); } catch (FileNotFoundException e) { - Log.e(Settings.tag, "LocalStorage.copy: could not open file", e); + Log.e("LocalStorage.copy: could not open file", e); if (input != null) { try { input.close(); @@ -274,7 +273,7 @@ public class LocalStorage { input.close(); output.close(); } catch (IOException e) { - Log.e(Settings.tag, "LocalStorage.copy: could not close file", e); + Log.e("LocalStorage.copy: could not close file", e); return false; } @@ -291,7 +290,7 @@ public class LocalStorage { // Flushing is only necessary if the stream is not immediately closed afterwards. // We rely on all callers to do that correctly outside of this method } catch (IOException e) { - Log.e(Settings.tag, "LocalStorage.copy: error when copying data", e); + Log.e("LocalStorage.copy: error when copying data", e); return false; } diff --git a/main/src/cgeo/geocaching/gcvote/GCVote.java b/main/src/cgeo/geocaching/gcvote/GCVote.java index eb0320f..636a242 100644 --- a/main/src/cgeo/geocaching/gcvote/GCVote.java +++ b/main/src/cgeo/geocaching/gcvote/GCVote.java @@ -117,7 +117,7 @@ public final class GCVote { } } } catch (Exception e) { - Log.w(Settings.tag, "GCVote.getRating: Failed to parse guid"); + Log.w("GCVote.getRating: Failed to parse guid"); } if (guid == null) { continue; @@ -134,7 +134,7 @@ public final class GCVote { } } } catch (Exception e) { - Log.w(Settings.tag, "GCVote.getRating: Failed to parse loggedIn"); + Log.w("GCVote.getRating: Failed to parse loggedIn"); } float rating = 0; @@ -144,7 +144,7 @@ public final class GCVote { rating = Float.parseFloat(matcherRating.group(1)); } } catch (Exception e) { - Log.w(Settings.tag, "GCVote.getRating: Failed to parse rating"); + Log.w("GCVote.getRating: Failed to parse rating"); } if (rating <= 0) { continue; @@ -157,7 +157,7 @@ public final class GCVote { votes = Integer.parseInt(matcherVotes.group(1)); } } catch (Exception e) { - Log.w(Settings.tag, "GCVote.getRating: Failed to parse vote count"); + Log.w("GCVote.getRating: Failed to parse vote count"); } if (votes < 0) { continue; @@ -171,7 +171,7 @@ public final class GCVote { myVote = Float.parseFloat(matcherVote.group(1)); } } catch (Exception e) { - Log.w(Settings.tag, "GCVote.getRating: Failed to parse user's vote"); + Log.w("GCVote.getRating: Failed to parse user's vote"); } } @@ -182,7 +182,7 @@ public final class GCVote { } } } catch (Exception e) { - Log.e(Settings.tag, "GCVote.getRating: " + e.toString()); + Log.e("GCVote.getRating: " + e.toString()); } return ratings; @@ -257,7 +257,7 @@ public final class GCVote { } } } catch (Exception e) { - Log.e(Settings.tag, "GCvote.loadRatings: " + e.toString()); + Log.e("GCvote.loadRatings: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/geopoint/Geopoint.java b/main/src/cgeo/geocaching/geopoint/Geopoint.java index a672a6e..b916e51 100644 --- a/main/src/cgeo/geocaching/geopoint/Geopoint.java +++ b/main/src/cgeo/geocaching/geopoint/Geopoint.java @@ -1,7 +1,6 @@ package cgeo.geocaching.geopoint; import cgeo.geocaching.ICoordinates; -import cgeo.geocaching.Settings; import cgeo.geocaching.geopoint.GeopointFormatter.Format; import cgeo.geocaching.network.Network; import cgeo.geocaching.network.Parameters; @@ -498,7 +497,7 @@ public final class Geopoint implements ICoordinates { return result.getDouble("elevation"); } } catch (Exception e) { - Log.w(Settings.tag, "cgBase.getElevation: " + e.toString()); + Log.w("cgBase.getElevation: " + e.toString()); } return null; diff --git a/main/src/cgeo/geocaching/go4cache/Go4Cache.java b/main/src/cgeo/geocaching/go4cache/Go4Cache.java index 6271245..782919c 100644 --- a/main/src/cgeo/geocaching/go4cache/Go4Cache.java +++ b/main/src/cgeo/geocaching/go4cache/Go4Cache.java @@ -68,7 +68,7 @@ public final class Go4Cache extends Thread { @Override public void run() { - Log.d(Settings.tag, "Go4Cache task started"); + Log.d("Go4Cache task started"); Geopoint latestCoords = null; String latestAction = null; @@ -108,7 +108,7 @@ public final class Go4Cache extends Thread { latestAction = currentAction; } } catch (InterruptedException e) { - Log.e(Settings.tag, "Go4Cache.run: interrupted", e); + Log.e("Go4Cache.run: interrupted", e); } } @@ -138,7 +138,7 @@ public final class Go4Cache extends Thread { final String data = Network.getResponseData(Network.postRequest("http://api.go4cache.com/get.php", params)); if (StringUtils.isBlank(data)) { - Log.e(Settings.tag, "cgeoBase.getGeocachersInViewport: No data from server"); + Log.e("cgeoBase.getGeocachersInViewport: No data from server"); return null; } @@ -150,7 +150,7 @@ public final class Go4Cache extends Thread { users.add(parseUser(oneUser)); } } catch (Exception e) { - Log.e(Settings.tag, "cgBase.getGeocachersInViewport: " + e.toString()); + Log.e("cgBase.getGeocachersInViewport: " + e.toString()); } return Collections.unmodifiableList(users); diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 09aeabd..300acf5 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -673,7 +673,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto menu.findItem(SUBMENU_STRATEGY).setEnabled(live); } catch (Exception e) { - Log.e(Settings.tag, "cgeomap.onPrepareOptionsMenu: " + e.toString()); + Log.e("cgeomap.onPrepareOptionsMenu: " + e.toString()); } return true; @@ -716,7 +716,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto } } } catch (Exception e) { - Log.e(Settings.tag, "cgeomap.onOptionsItemSelected.#4: " + e.toString()); + Log.e("cgeomap.onOptionsItemSelected.#4: " + e.toString()); } detailTotal = geocodes.size(); @@ -750,7 +750,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto dir = app.startDir(activity, dirUpdate); } } catch (Exception e) { - Log.e(Settings.tag, "cgeocaches.onPrepareOptionsMenu.onCancel: " + e.toString()); + Log.e("cgeocaches.onPrepareOptionsMenu.onCancel: " + e.toString()); } } }); @@ -910,7 +910,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto } } catch (Exception e) { - Log.w(Settings.tag, "Failed to update location."); + Log.w("Failed to update location."); } } } @@ -1036,7 +1036,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto yield(); } catch (Exception e) { - Log.w(Settings.tag, "cgeomap.LoadTimer.run: " + e.toString()); + Log.w("cgeomap.LoadTimer.run: " + e.toString()); } } } @@ -1109,7 +1109,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto yield(); } catch (Exception e) { - Log.w(Settings.tag, "cgeomap.LoadUsersTimer.run: " + e.toString()); + Log.w("cgeomap.LoadUsersTimer.run: " + e.toString()); } } } @@ -1230,7 +1230,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto displayExecutor.execute(new DisplayRunnable(centerLat, centerLon, spanLat, spanLon)); } catch (ThreadDeath e) { - Log.d(Settings.tag, "DownloadThread stopped"); + Log.d("DownloadThread stopped"); displayHandler.sendEmptyMessage(UPDATE_TITLE); } finally { showProgressHandler.sendEmptyMessage(HIDE_PROGRESS); // hide progress @@ -1293,7 +1293,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto displayHandler.sendEmptyMessage(UPDATE_TITLE); } catch (ThreadDeath e) { - Log.d(Settings.tag, "DisplayThread stopped"); + Log.d("DisplayThread stopped"); displayHandler.sendEmptyMessage(UPDATE_TITLE); } finally { showProgressHandler.sendEmptyMessage(HIDE_PROGRESS); @@ -1482,7 +1482,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto } if (handler.isCancelled()) { - Log.i(Settings.tag, "Stopped storing process."); + Log.i("Stopped storing process."); break; } @@ -1490,7 +1490,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto cgBase.storeCache(activity, null, geocode, StoredList.STANDARD_LIST_ID, false, handler); } } catch (Exception e) { - Log.e(Settings.tag, "cgeocaches.LoadDetails.run: " + e.toString()); + Log.e("cgeocaches.LoadDetails.run: " + e.toString()); } finally { // one more cache over detailProgress++; diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java index 4094280..2ff3d90 100644 --- a/main/src/cgeo/geocaching/maps/CachesOverlay.java +++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java @@ -247,7 +247,7 @@ public class CachesOverlay extends AbstractItemizedOverlay { waitDialog.dismiss(); } catch (Exception e) { - Log.e(Settings.tag, "cgMapOverlay.onTap: " + e.toString()); + Log.e("cgMapOverlay.onTap: " + e.toString()); } return false; @@ -258,7 +258,7 @@ public class CachesOverlay extends AbstractItemizedOverlay { try { return items.get(index); } catch (Exception e) { - Log.e(Settings.tag, "cgMapOverlay.createItem: " + e.toString()); + Log.e("cgMapOverlay.createItem: " + e.toString()); } return null; @@ -269,7 +269,7 @@ public class CachesOverlay extends AbstractItemizedOverlay { try { return items.size(); } catch (Exception e) { - Log.e(Settings.tag, "cgMapOverlay.size: " + e.toString()); + Log.e("cgMapOverlay.size: " + e.toString()); } return 0; diff --git a/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java b/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java index 9cc20f1..cffbe77 100644 --- a/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java +++ b/main/src/cgeo/geocaching/maps/OtherCachersOverlay.java @@ -1,7 +1,6 @@ package cgeo.geocaching.maps; import cgeo.geocaching.CacheDetailActivity; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.go4cache.Go4CacheUser; import cgeo.geocaching.maps.interfaces.ItemizedOverlayImpl; @@ -92,7 +91,7 @@ public class OtherCachersOverlay extends AbstractItemizedOverlay { return true; } catch (Exception e) { - Log.e(Settings.tag, "cgUsersOverlay.onTap: " + e.toString()); + Log.e("cgUsersOverlay.onTap: " + e.toString()); } return false; @@ -108,7 +107,7 @@ public class OtherCachersOverlay extends AbstractItemizedOverlay { try { return items.get(index); } catch (Exception e) { - Log.e(Settings.tag, "cgUsersOverlay.createItem: " + e.toString()); + Log.e("cgUsersOverlay.createItem: " + e.toString()); } return null; @@ -119,7 +118,7 @@ public class OtherCachersOverlay extends AbstractItemizedOverlay { try { return items.size(); } catch (Exception e) { - Log.e(Settings.tag, "cgUsersOverlay.size: " + e.toString()); + Log.e("cgUsersOverlay.size: " + e.toString()); } return 0; diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java index 9c23035..deebcce 100644 --- a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java +++ b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java @@ -60,7 +60,7 @@ public class GoogleMapView extends MapView implements MapViewImpl { super.draw(canvas); } catch (Exception e) { - Log.e(Settings.tag, "GoogleMapView.draw: " + e.toString()); + Log.e("GoogleMapView.draw: " + e.toString()); } } @@ -74,7 +74,7 @@ public class GoogleMapView extends MapView implements MapViewImpl { super.displayZoomControls(takeFocus); } catch (Exception e) { - Log.e(Settings.tag, "GoogleMapView.displayZoomControls: " + e.toString()); + Log.e("GoogleMapView.displayZoomControls: " + e.toString()); } } diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java index 78bcd54..d66088e 100644 --- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java +++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java @@ -49,7 +49,7 @@ public class MapsforgeMapView extends MapView implements MapViewImpl { super.draw(canvas); } catch (Exception e) { - Log.e(Settings.tag, "MapsforgeMapView.draw: " + e.toString()); + Log.e("MapsforgeMapView.draw: " + e.toString()); } } @@ -196,7 +196,7 @@ public class MapsforgeMapView extends MapView implements MapViewImpl { } } catch (Exception e) { - Log.e(Settings.tag, "MapsforgeMapView.repaintRequired: " + e.toString()); + Log.e("MapsforgeMapView.repaintRequired: " + e.toString()); } } } diff --git a/main/src/cgeo/geocaching/network/HtmlImage.java b/main/src/cgeo/geocaching/network/HtmlImage.java index 6cb4b86..cd89a06 100644 --- a/main/src/cgeo/geocaching/network/HtmlImage.java +++ b/main/src/cgeo/geocaching/network/HtmlImage.java @@ -1,7 +1,6 @@ package cgeo.geocaching.network; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.StoredList; import cgeo.geocaching.connector.ConnectorFactory; import cgeo.geocaching.files.LocalStorage; @@ -91,7 +90,7 @@ public class HtmlImage implements Html.ImageGetter { } } } catch (Exception e) { - Log.e(Settings.tag, "HtmlImage.getDrawable (downloading from web)", e); + Log.e("HtmlImage.getDrawable (downloading from web)", e); } } } @@ -107,7 +106,7 @@ public class HtmlImage implements Html.ImageGetter { // get image and return if (imagePre == null) { - Log.d(Settings.tag, "HtmlImage.getDrawable: Failed to obtain image"); + Log.d("HtmlImage.getDrawable: Failed to obtain image"); if (returnErrorImage) { imagePre = BitmapFactory.decodeResource(context.getResources(), R.drawable.image_not_loaded); @@ -130,7 +129,7 @@ public class HtmlImage implements Html.ImageGetter { try { imagePre = Bitmap.createScaledBitmap(imagePre, width, height, true); } catch (Exception e) { - Log.d(Settings.tag, "HtmlImage.getDrawable: Failed to scale image"); + Log.d("HtmlImage.getDrawable: Failed to scale image"); return null; } } else { @@ -158,7 +157,7 @@ public class HtmlImage implements Html.ImageGetter { final File fileSec = LocalStorage.getStorageSecFile(geocode, url, true); return loadCachedImage(fileSec); } catch (Exception e) { - Log.w(Settings.tag, "HtmlImage.getDrawable (reading cache): " + e.toString()); + Log.w("HtmlImage.getDrawable (reading cache): " + e.toString()); } return null; } @@ -182,7 +181,7 @@ public class HtmlImage implements Html.ImageGetter { } } } catch (Exception e) { - Log.e(Settings.tag, "HtmlImage.makeAbsoluteURL (parse URL)", e); + Log.e("HtmlImage.makeAbsoluteURL (parse URL)", e); } return null; } @@ -207,7 +206,7 @@ public class HtmlImage implements Html.ImageGetter { fis = new FileInputStream(file); BitmapFactory.decodeStream(fis, null, options); } catch (FileNotFoundException e) { - Log.e(Settings.tag, "HtmlImage.setSampleSize", e); + Log.e("HtmlImage.setSampleSize", e); } finally { if (fis != null) { try { diff --git a/main/src/cgeo/geocaching/network/Login.java b/main/src/cgeo/geocaching/network/Login.java index fe78978..200daaf 100644 --- a/main/src/cgeo/geocaching/network/Login.java +++ b/main/src/cgeo/geocaching/network/Login.java @@ -61,7 +61,7 @@ public abstract class Login { if (login == null || StringUtils.isEmpty(login.left) || StringUtils.isEmpty(login.right)) { Login.setActualStatus(cgBase.res.getString(R.string.err_login)); - Log.e(Settings.tag, "cgeoBase.login: No login information stored"); + Log.e("cgeoBase.login: No login information stored"); return StatusCode.NO_LOGIN_INFO_STORED; } @@ -76,12 +76,12 @@ public abstract class Login { } if (StringUtils.isBlank(loginData)) { - Log.e(Settings.tag, "cgeoBase.login: Failed to retrieve login page (1st)"); + Log.e("cgeoBase.login: Failed to retrieve login page (1st)"); return StatusCode.CONNECTION_FAILED; // no loginpage } if (Login.getLoginStatus(loginData)) { - Log.i(Settings.tag, "Already logged in Geocaching.com as " + login.left); + Log.i("Already logged in Geocaching.com as " + login.left); Login.switchToEnglish(loginData); return StatusCode.NO_ERROR; // logged in } @@ -98,7 +98,7 @@ public abstract class Login { "ctl00$ContentBody$btnSignIn", "Login"); final String[] viewstates = Login.getViewstates(loginData); if (cgBase.isEmpty(viewstates)) { - Log.e(Settings.tag, "cgeoBase.login: Failed to find viewstates"); + Log.e("cgeoBase.login: Failed to find viewstates"); return StatusCode.LOGIN_PARSE_ERROR; // no viewstates } Login.putViewstates(params, viewstates); @@ -108,7 +108,7 @@ public abstract class Login { if (StringUtils.isNotBlank(loginData)) { if (Login.getLoginStatus(loginData)) { - Log.i(Settings.tag, "Successfully logged in Geocaching.com as " + login.left); + Log.i("Successfully logged in Geocaching.com as " + login.left); Login.switchToEnglish(loginData); Settings.setCookieStore(Network.dumpCookieStore()); @@ -116,15 +116,15 @@ public abstract class Login { return StatusCode.NO_ERROR; // logged in } else { if (loginData.contains("Your username/password combination does not match.")) { - Log.i(Settings.tag, "Failed to log in Geocaching.com as " + login.left + " because of wrong username/password"); + Log.i("Failed to log in Geocaching.com as " + login.left + " because of wrong username/password"); return StatusCode.WRONG_LOGIN_DATA; // wrong login } else { - Log.i(Settings.tag, "Failed to log in Geocaching.com as " + login.left + " for some unknown reason"); + Log.i("Failed to log in Geocaching.com as " + login.left + " for some unknown reason"); return StatusCode.UNKNOWN_ERROR; // can't login } } } else { - Log.e(Settings.tag, "cgeoBase.login: Failed to retrieve login page (2nd)"); + Log.e("cgeoBase.login: Failed to retrieve login page (2nd)"); // FIXME: should it be CONNECTION_FAILED to match the first attempt? return StatusCode.COMMUNICATION_ERROR; // no login page } @@ -182,7 +182,7 @@ public abstract class Login { */ public static boolean getLoginStatus(final String page) { if (StringUtils.isBlank(page)) { - Log.e(Settings.tag, "cgeoBase.checkLogin: No page given"); + Log.e("cgeoBase.checkLogin: No page given"); return false; } @@ -216,14 +216,14 @@ public abstract class Login { private static void switchToEnglish(String previousPage) { if (previousPage != null && previousPage.indexOf(ENGLISH) >= 0) { - Log.i(Settings.tag, "Geocaching.com language already set to English"); + Log.i("Geocaching.com language already set to English"); // get find count getLoginStatus(Network.getResponseData(Network.request("http://www.geocaching.com/email/", null, false))); } else { final String page = Network.getResponseData(Network.request("http://www.geocaching.com/default.aspx", null, false)); getLoginStatus(page); if (page == null) { - Log.e(Settings.tag, "Failed to read viewstates to set geocaching.com language"); + Log.e("Failed to read viewstates to set geocaching.com language"); } final Parameters params = new Parameters( "__EVENTTARGET", "ctl00$uxLocaleList$uxLocaleList$ctl00$uxLocaleItem", // switch to english @@ -231,7 +231,7 @@ public abstract class Login { Login.transferViewstates(page, params); final HttpResponse response = Network.postRequest("http://www.geocaching.com/default.aspx", params); if (!Network.isSuccess(response)) { - Log.e(Settings.tag, "Failed to set geocaching.com language to English"); + Log.e("Failed to set geocaching.com language to English"); } } } @@ -250,9 +250,9 @@ public abstract class Login { return imgGetter.getDrawable(avatarURL); } // No match? There may be no avatar set by user. - Log.d(Settings.tag, "No avatar set for user"); + Log.d("No avatar set for user"); } catch (Exception e) { - Log.w(Settings.tag, "Error when retrieving user avatar", e); + Log.w("Error when retrieving user avatar", e); } return null; } @@ -265,7 +265,7 @@ public abstract class Login { final String result = Network.getResponseData(Network.request("http://www.geocaching.com/account/ManagePreferences.aspx", null, false, false, false)); if (null == result) { - Log.w(Settings.tag, "cgeoBase.detectGcCustomDate: result is null"); + Log.w("cgeoBase.detectGcCustomDate: result is null"); return; } @@ -322,7 +322,7 @@ public abstract class Login { try { count = Integer.parseInt(matcherViewstateCount.group(1)); } catch (NumberFormatException e) { - Log.e(Settings.tag, "getViewStates", e); + Log.e("getViewStates", e); } } @@ -340,7 +340,7 @@ public abstract class Login { try { no = Integer.parseInt(sno); } catch (NumberFormatException e) { - Log.e(Settings.tag, "getViewStates", e); + Log.e("getViewStates", e); no = 0; } } diff --git a/main/src/cgeo/geocaching/network/Network.java b/main/src/cgeo/geocaching/network/Network.java index 502db33..008f887 100644 --- a/main/src/cgeo/geocaching/network/Network.java +++ b/main/src/cgeo/geocaching/network/Network.java @@ -1,6 +1,5 @@ package cgeo.geocaching.network; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgBase; import cgeo.geocaching.enumerations.StatusCode; import cgeo.geocaching.files.LocalStorage; @@ -117,7 +116,7 @@ public abstract class Network { HeaderElement[] codecs = ceheader.getElements(); for (int i = 0; i < codecs.length; i++) { if (codecs[i].getName().equalsIgnoreCase("gzip")) { - Log.d(Settings.tag, "Decompressing response"); + Log.d("Decompressing response"); response.setEntity( new Network.GzipDecompressingEntity(response.getEntity())); return; @@ -183,7 +182,7 @@ public abstract class Network { return Network.request(request); } catch (Exception e) { // Can be UnsupportedEncodingException, ClientProtocolException or IOException - Log.e(Settings.tag, "postRequest", e); + Log.e("postRequest", e); return null; } } @@ -258,7 +257,7 @@ public abstract class Network { private static HttpResponse doRequest(final HttpRequestBase request) { final String reqLogStr = request.getMethod() + " " + hidePassword(request.getURI().toString()); - Log.d(Settings.tag, reqLogStr); + Log.d(reqLogStr); final HttpClient client = getHttpClient(); for (int i = 0; i <= NB_DOWNLOAD_RETRIES; i++) { @@ -267,18 +266,18 @@ public abstract class Network { final HttpResponse response = client.execute(request); int status = response.getStatusLine().getStatusCode(); if (status == 200) { - Log.d(Settings.tag, status + Network.formatTimeSpan(before) + reqLogStr); + Log.d(status + Network.formatTimeSpan(before) + reqLogStr); } else { - Log.w(Settings.tag, status + " [" + response.getStatusLine().getReasonPhrase() + "]" + Network.formatTimeSpan(before) + reqLogStr); + Log.w(status + " [" + response.getStatusLine().getReasonPhrase() + "]" + Network.formatTimeSpan(before) + reqLogStr); } return response; } catch (IOException e) { final String timeSpan = Network.formatTimeSpan(before); final String tries = (i + 1) + "/" + (NB_DOWNLOAD_RETRIES + 1); if (i == NB_DOWNLOAD_RETRIES) { - Log.e(Settings.tag, "Failure " + tries + timeSpan + reqLogStr, e); + Log.e("Failure " + tries + timeSpan + reqLogStr, e); } else { - Log.e(Settings.tag, "Failure " + tries + " (" + e.toString() + ")" + timeSpan + "- retrying " + reqLogStr); + Log.e("Failure " + tries + " (" + e.toString() + ")" + timeSpan + "- retrying " + reqLogStr); } } } @@ -306,7 +305,7 @@ public abstract class Network { try { return new JSONObject(Network.getResponseData(response)); } catch (JSONException e) { - Log.e(Settings.tag, "Network.requestJSON", e); + Log.e("Network.requestJSON", e); } } @@ -322,7 +321,7 @@ public abstract class Network { String data = EntityUtils.toString(response.getEntity(), HTTP.UTF_8); return replaceWhitespace ? BaseUtils.replaceWhitespace(data) : data; } catch (Exception e) { - Log.e(Settings.tag, "getResponseData", e); + Log.e("getResponseData", e); return null; } } @@ -353,7 +352,7 @@ public abstract class Network { response = postRequest(uri, null); data = getResponseData(response); } else { - Log.i(Settings.tag, "Working as guest."); + Log.i("Working as guest."); } } return data; @@ -378,7 +377,7 @@ public abstract class Network { response = request(uri, params, xContentType, my, addF); data = getResponseData(response); } else { - Log.i(Settings.tag, "Working as guest."); + Log.i("Working as guest."); } } return data; diff --git a/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java b/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java index f008528..9c3f15b 100644 --- a/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java +++ b/main/src/cgeo/geocaching/sorting/AbstractCacheComparator.java @@ -1,7 +1,6 @@ package cgeo.geocaching.sorting; import cgeo.geocaching.cgCache; -import cgeo.geocaching.Settings; import cgeo.geocaching.utils.Log; @@ -20,7 +19,7 @@ public abstract class AbstractCacheComparator implements CacheComparator { } return compareCaches(cache1, cache2); } catch (Exception e) { - Log.e(Settings.tag, "AbstractCacheComparator.compare: " + e.toString()); + Log.e("AbstractCacheComparator.compare: " + e.toString()); } return 0; } diff --git a/main/src/cgeo/geocaching/twitter/Twitter.java b/main/src/cgeo/geocaching/twitter/Twitter.java index 0696cf1..4a10046 100644 --- a/main/src/cgeo/geocaching/twitter/Twitter.java +++ b/main/src/cgeo/geocaching/twitter/Twitter.java @@ -38,12 +38,12 @@ public final class Twitter { OAuth.signOAuth("api.twitter.com", "/1/statuses/update.json", "POST", false, parameters, Settings.getTokenPublic(), Settings.getTokenSecret()); final HttpResponse httpResponse = Network.postRequest("http://api.twitter.com/1/statuses/update.json", parameters); if (httpResponse != null && httpResponse.getStatusLine().getStatusCode() == 200) { - Log.i(Settings.tag, "Tweet posted"); + Log.i("Tweet posted"); } else { - Log.e(Settings.tag, "Tweet could not be posted"); + Log.e("Tweet could not be posted"); } } catch (Exception e) { - Log.e(Settings.tag, "cgBase.postTweet: " + e.toString()); + Log.e("cgBase.postTweet: " + e.toString()); } } diff --git a/main/src/cgeo/geocaching/twitter/TwitterAuthorizationActivity.java b/main/src/cgeo/geocaching/twitter/TwitterAuthorizationActivity.java index c9710e9..78764c2 100644 --- a/main/src/cgeo/geocaching/twitter/TwitterAuthorizationActivity.java +++ b/main/src/cgeo/geocaching/twitter/TwitterAuthorizationActivity.java @@ -164,12 +164,12 @@ public class TwitterAuthorizationActivity extends AbstractActivity { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://" + host + pathAuthorize + "?" + encodedParams))); status = 1; } catch (Exception e) { - Log.e(Settings.tag, "TwitterAuthorizationActivity.requestToken(2): " + e.toString()); + Log.e("TwitterAuthorizationActivity.requestToken(2): " + e.toString()); } } } } catch (Exception e) { - Log.e(Settings.tag, "TwitterAuthorizationActivity.requestToken(1): " + e.toString()); + Log.e("TwitterAuthorizationActivity.requestToken(1): " + e.toString()); } requestTokenHandler.sendEmptyMessage(status); @@ -209,7 +209,7 @@ public class TwitterAuthorizationActivity extends AbstractActivity { status = 1; } } catch (Exception e) { - Log.e(Settings.tag, "TwitterAuthorizationActivity.changeToken: " + e.toString()); + Log.e("TwitterAuthorizationActivity.changeToken: " + e.toString()); } changeTokensHandler.sendEmptyMessage(status); diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java index c6205f6..516ab4b 100644 --- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java +++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java @@ -364,7 +364,7 @@ public class CacheListAdapter extends ArrayAdapter<cgCache> { } if (position > getCount()) { - Log.w(Settings.tag, "CacheListAdapter.getView: Attempt to access missing item #" + position); + Log.w("CacheListAdapter.getView: Attempt to access missing item #" + position); return null; } @@ -770,7 +770,7 @@ public class CacheListAdapter extends ArrayAdapter<cgCache> { return true; } } catch (Exception e) { - Log.w(Settings.tag, "CacheListAdapter.detectGesture.onFling: " + e.toString()); + Log.w("CacheListAdapter.detectGesture.onFling: " + e.toString()); } return false; diff --git a/main/src/cgeo/geocaching/ui/CompassView.java b/main/src/cgeo/geocaching/ui/CompassView.java index 7f6f792..d9e0bfe 100644 --- a/main/src/cgeo/geocaching/ui/CompassView.java +++ b/main/src/cgeo/geocaching/ui/CompassView.java @@ -1,7 +1,6 @@ package cgeo.geocaching.ui; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.utils.Log; import android.content.Context; @@ -58,7 +57,7 @@ public class CompassView extends View { try { invalidate(); } catch (Exception e) { - Log.e(Settings.tag, "CompassView.changeHandler: " + e.toString()); + Log.e("CompassView.changeHandler: " + e.toString()); } } }; diff --git a/main/src/cgeo/geocaching/ui/GPXListAdapter.java b/main/src/cgeo/geocaching/ui/GPXListAdapter.java index 5a58840..aa2234a 100644 --- a/main/src/cgeo/geocaching/ui/GPXListAdapter.java +++ b/main/src/cgeo/geocaching/ui/GPXListAdapter.java @@ -1,7 +1,6 @@ package cgeo.geocaching.ui; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgeogpxes; import cgeo.geocaching.files.GPXImporter; import cgeo.geocaching.utils.Log; @@ -34,7 +33,7 @@ public class GPXListAdapter extends ArrayAdapter<File> { } if (position > getCount()) { - Log.w(Settings.tag, "cgGPXListAdapter.getView: Attempt to access missing item #" + position); + Log.w("cgGPXListAdapter.getView: Attempt to access missing item #" + position); return null; } diff --git a/main/src/cgeo/geocaching/ui/MapfileListAdapter.java b/main/src/cgeo/geocaching/ui/MapfileListAdapter.java index c4720d5..e7380f0 100644 --- a/main/src/cgeo/geocaching/ui/MapfileListAdapter.java +++ b/main/src/cgeo/geocaching/ui/MapfileListAdapter.java @@ -1,7 +1,6 @@ package cgeo.geocaching.ui; import cgeo.geocaching.R; -import cgeo.geocaching.Settings; import cgeo.geocaching.cgSelectMapfile; import cgeo.geocaching.utils.Log; @@ -35,7 +34,7 @@ public class MapfileListAdapter extends ArrayAdapter<File> { } if (position > getCount()) { - Log.w(Settings.tag, "cgGPXListAdapter.getView: Attempt to access missing item #" + position); + Log.w("cgGPXListAdapter.getView: Attempt to access missing item #" + position); return null; } diff --git a/main/src/cgeo/geocaching/utils/CryptUtils.java b/main/src/cgeo/geocaching/utils/CryptUtils.java index 4cf0de2..f04327e 100644 --- a/main/src/cgeo/geocaching/utils/CryptUtils.java +++ b/main/src/cgeo/geocaching/utils/CryptUtils.java @@ -1,6 +1,5 @@ package cgeo.geocaching.utils; -import cgeo.geocaching.Settings; import android.text.Spannable; import android.text.SpannableStringBuilder; @@ -74,7 +73,7 @@ public final class CryptUtils { digest.update(text.getBytes(), 0, text.length()); hashed = new BigInteger(1, digest.digest()).toString(16); } catch (Exception e) { - Log.e(Settings.tag, "cgBase.md5: " + e.toString()); + Log.e("cgBase.md5: " + e.toString()); } return hashed; @@ -88,7 +87,7 @@ public final class CryptUtils { digest.update(text.getBytes(), 0, text.length()); hashed = new BigInteger(1, digest.digest()).toString(16); } catch (Exception e) { - Log.e(Settings.tag, "cgBase.sha1: " + e.toString()); + Log.e("cgBase.sha1: " + e.toString()); } return hashed; @@ -103,7 +102,7 @@ public final class CryptUtils { mac.init(secretKeySpec); macBytes = mac.doFinal(text.getBytes()); } catch (Exception e) { - Log.e(Settings.tag, "cgBase.hashHmac: " + e.toString()); + Log.e("cgBase.hashHmac: " + e.toString()); } return macBytes; diff --git a/main/src/cgeo/geocaching/utils/Log.java b/main/src/cgeo/geocaching/utils/Log.java index caa13ee..a985cac 100644 --- a/main/src/cgeo/geocaching/utils/Log.java +++ b/main/src/cgeo/geocaching/utils/Log.java @@ -4,65 +4,65 @@ import cgeo.geocaching.Settings; final public class Log { - //FIXME: tag should be private member of this log class - public static void v(final String tag, final String msg) { + public static void v(final String msg) { if (Settings.isDebug()) { android.util.Log.v(tag, msg); } } - public static void v(final String tag, final String msg, final Throwable t) { + public static void v(final String msg, final Throwable t) { if (Settings.isDebug()) { android.util.Log.v(tag, msg, t); } } - public static void d(final String tag, final String msg) { + public static void d(final String msg) { if (Settings.isDebug()) { android.util.Log.d(tag, msg); } } - public static void d(final String tag, final String msg, final Throwable t) { + public static void d(final String msg, final Throwable t) { if (Settings.isDebug()) { android.util.Log.d(tag, msg, t); } } - public static void i(final String tag, final String msg) { + public static void i(final String msg) { if (Settings.isDebug()) { android.util.Log.i(tag, msg); } } - public static void i(final String tag, final String msg, final Throwable t) { + public static void i(final String msg, final Throwable t) { if (Settings.isDebug()) { android.util.Log.i(tag, msg, t); } } - public static void w(final String tag, final String msg) { + public static void w(final String msg) { android.util.Log.w(tag, msg); } - public static void w(final String tag, final String msg, final Throwable t) { + public static void w(final String msg, final Throwable t) { android.util.Log.w(tag, msg, t); } - public static void e(final String tag, final String msg) { + public static void e(final String msg) { android.util.Log.e(tag, msg); } - public static void e(final String tag, final String msg, final Throwable t) { + public static void e(final String msg, final Throwable t) { android.util.Log.e(tag, msg, t); } - public static void wtf(final String tag, final String msg) { + public static void wtf(final String msg) { android.util.Log.wtf(tag, msg); } - public static void wtf(final String tag, final String msg, final Throwable t) { + public static void wtf(final String msg, final Throwable t) { android.util.Log.wtf(tag, msg, t); } + private static final String tag = "cgeo"; } diff --git a/main/src/cgeo/geocaching/utils/LogTemplateProvider.java b/main/src/cgeo/geocaching/utils/LogTemplateProvider.java index 9a5e422..04a8c7a 100644 --- a/main/src/cgeo/geocaching/utils/LogTemplateProvider.java +++ b/main/src/cgeo/geocaching/utils/LogTemplateProvider.java @@ -133,7 +133,7 @@ public class LogTemplateProvider { try { return Integer.parseInt(BaseUtils.getMatch(page, GCConstants.PATTERN_CACHES_FOUND, true, "-1").replaceAll("[,.]", "")); } catch (NumberFormatException e) { - Log.e(Settings.tag, "parseFindCount", e); + Log.e("parseFindCount", e); return -1; } } |