Skip to content

Commit

Permalink
Silence debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynovikov committed Feb 7, 2024
1 parent 3d9b54c commit d6066a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
14 changes: 6 additions & 8 deletions app/src/main/java/mobi/maptrek/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/mobi/maptrek/fragments/DataList.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
};

Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d6066a5

Please sign in to comment.