From d6066a5524e972956548a02c526250532962ea76 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Wed, 7 Feb 2024 11:28:57 +0300 Subject: [PATCH] Silence debug logging --- app/src/main/java/mobi/maptrek/MainActivity.java | 14 ++++++-------- .../main/java/mobi/maptrek/fragments/DataList.java | 4 ++-- .../mobi/maptrek/fragments/TrackInformation.java | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/mobi/maptrek/MainActivity.java b/app/src/main/java/mobi/maptrek/MainActivity.java index b4a1a148..328a0e2a 100644 --- a/app/src/main/java/mobi/maptrek/MainActivity.java +++ b/app/src/main/java/mobi/maptrek/MainActivity.java @@ -913,8 +913,8 @@ protected void onResume() { askForPermission(PERMISSIONS_REQUEST_FINE_LOCATION); TRACKING_STATE savedState = TRACKING_STATE.values()[Configuration.getTrackingState()]; - logger.error("Saved tracking state: {}", savedState); - logger.error("Current tracking state: {}", trackViewModel.trackingState.getValue()); + logger.info("Saved tracking state: {}", savedState); + logger.info("Current tracking state: {}", trackViewModel.trackingState.getValue()); if (savedState != trackViewModel.trackingState.getValue()) { if (savedState == TRACKING_STATE.TRACKING) enableTracking(); @@ -923,7 +923,7 @@ else if (savedState == TRACKING_STATE.PAUSED) } trackViewModel.trackingState.observe(this, trackingState -> { - logger.error("trackingState changed: {}", trackingState); + logger.info("trackingState changed: {}", trackingState); int recordColor = trackingState == TRACKING_STATE.TRACKING ? mColorAccent : mColorActionIcon; mViews.tracksButton.getDrawable().setTint(recordColor); @@ -952,7 +952,7 @@ public void onTargetDismissed(TapTargetView view, boolean userInitiated) { }); trackViewModel.trackingCommand.observe(this, trackingCommand -> { TRACKING_STATE trackingState = trackViewModel.trackingState.getValue(); - logger.error("trackingCommand received: {}, state: {}", trackingCommand, trackingState); + logger.info("trackingCommand received: {}, state: {}", trackingCommand, trackingState); if (trackingState == trackingCommand) return; if (trackingCommand == TRACKING_STATE.PENDING && trackingState != TRACKING_STATE.TRACKING) { @@ -2016,7 +2016,7 @@ public void setHighlightedType(int type) { } private void enableTracking() { - logger.error("enableTracking"); + logger.info("enableTracking"); Intent intent = new Intent(getApplicationContext(), LocationService.class).setAction(BaseLocationService.ENABLE_TRACK); if (Build.VERSION.SDK_INT >= 26) startForegroundService(intent); @@ -3633,8 +3633,6 @@ private void adjustPanelConstraint(int gravity, View ref) { case Gravity.END: params.topToTop = ConstraintLayout.LayoutParams.UNSET; params.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID; - if (ref != null) - logger.error("{} {}", mViews.constraintLayout.getHeight(), ref.getY()); if (ref != null) params.matchConstraintMinHeight = (int) (mViews.constraintLayout.getHeight() - ref.getY()); break; @@ -4136,7 +4134,7 @@ public void onReceive(Context context, Intent intent) { if (BaseLocationService.BROADCAST_TRACK_STATE.equals(action)) { int stateOrdinal = intent.getIntExtra("state", TRACKING_STATE.DISABLED.ordinal()); TRACKING_STATE state = TRACKING_STATE.values()[stateOrdinal]; - logger.error("{}: {}", action, state); + logger.info("{}: {}", action, state); trackViewModel.trackingState.setValue(state); } if (BaseLocationService.BROADCAST_TRACK_SAVE.equals(action)) { diff --git a/app/src/main/java/mobi/maptrek/fragments/DataList.java b/app/src/main/java/mobi/maptrek/fragments/DataList.java index cf51a614..7c7ea54f 100644 --- a/app/src/main/java/mobi/maptrek/fragments/DataList.java +++ b/app/src/main/java/mobi/maptrek/fragments/DataList.java @@ -466,7 +466,7 @@ public void onSelectionChanged() { @Override public void onSelectionRestored() { super.onSelectionRestored(); - logger.error("onSelectionRestored {}", selectionTracker.getSelection().size()); + logger.debug("onSelectionRestored {}", selectionTracker.getSelection().size()); } }; @@ -608,7 +608,7 @@ public int getItemCount() { @SuppressLint("NotifyDataSetChanged") @Override public void onDataSourceUpdated() { - logger.error("onDataSourceUpdated"); + logger.debug("onDataSourceUpdated"); cursor.close(); cursor = dataSource.getCursor(); calculateHeaders(); diff --git a/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java b/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java index 91d1e388..b6941746 100644 --- a/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java +++ b/app/src/main/java/mobi/maptrek/fragments/TrackInformation.java @@ -362,7 +362,7 @@ public void onChanged(Track.TrackPoint firstPoint) { viewBinding.charts.setVisibility(View.GONE); viewBinding.empty.setVisibility(View.VISIBLE); } else { - logger.error("firstPoint changed"); + logger.debug("firstPoint changed"); Activity activity = requireActivity(); viewBinding.startCoordinates.setText(StringFormatter.coordinates(firstPoint)); if (viewModel.hasTime) { @@ -390,7 +390,7 @@ public void onChanged(Track.TrackPoint firstPoint) { public void onChanged(Track.TrackPoint lastPoint) { if (lastPoint == null) return; - logger.error("lastPoint changed"); + logger.debug("lastPoint changed"); Activity activity = requireActivity(); viewBinding.finishCoordinates.setText(StringFormatter.coordinates(lastPoint)); if (viewModel.hasTime) {