Skip to content

Commit

Permalink
Better debugging messages (including fix to forgotten item)
Browse files Browse the repository at this point in the history
  • Loading branch information
renyuneyun committed Feb 19, 2018
1 parent e45da4a commit 542dbaf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/ryey/easer/core/EHService.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static long getLoadTime() {

@Override
public void onCreate() {
Logger.v("onCreate");
Logger.v("EHService onCreate()");
running = true;
Intent intent = new Intent(ACTION_STATE_CHANGED);
sendBroadcast(intent);
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/ryey/easer/core/Lotus.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,18 @@ synchronized void setStatus(boolean status) {
private synchronized void onSlotSatisfied() {
if (!repeatable && satisfied)
return;
Logger.i("event <%s> satisfied", eventTree.getName());
final String eventName = eventTree.getName();
Logger.i("event <%s> satisfied", eventName);
satisfied = true;
if (cooldownInMillisecond > 0) {
Calendar now = Calendar.getInstance();
if (lastSatisfied != null) {
if (now.getTimeInMillis() - lastSatisfied.getTimeInMillis() < cooldownInMillisecond) {
Logger.d("event <%s> is within cooldown time");
Logger.d("event <%s> is within cooldown time", eventName);
return;
}
}
Logger.d("event <%s> is not within cooldown time");
Logger.d("event <%s> is not within cooldown time", eventName);
lastSatisfied = now;
}
if (mSlot.canPromoteSub()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,23 @@ public ProfileLoaderIntentService() {

@Override
public void onCreate() {
Logger.v("onCreate()");
Logger.v("ProfileLoaderIntentService onCreate()");
super.onCreate();
}

@Override
protected void onHandleIntent(Intent intent) {
if (intent == null) {
Logger.wtf("Handling null intent");
Logger.wtf("ProfileLoaderIntentService got null Intent to handle");
return;
}
final String action = intent.getAction();
Logger.v("Handling intent with action <%s>", action);
if (ACTION_LOAD_PROFILE.equals(action)) {
final String name = intent.getStringExtra(EXTRA_PROFILE_NAME);
final String event = intent.getStringExtra(EXTRA_EVENT_NAME);
handleActionLoadProfile(name, event);
} else {
Logger.wtf("ProfileLoaderIntentService got unknown Intent action <%s>", action);
}
}

Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/ryey/easer/core/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
import android.view.MenuItem;
import android.widget.TextView;

import com.orhanobut.logger.Logger;

import ryey.easer.R;
import ryey.easer.core.data.storage.StorageHelper;
import ryey.easer.core.ui.edit.EventListFragment;
Expand Down Expand Up @@ -133,8 +131,6 @@ public void onBackPressed() {

@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
Logger.v("item: " + item.getTitle());

int id = item.getItemId();
FragmentManager manager = getSupportFragmentManager();
Fragment fragment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import android.os.Bundle;
import android.support.annotation.NonNull;

import com.orhanobut.logger.Logger;

import java.util.ArrayList;

import ryey.easer.Utils;
Expand Down

0 comments on commit 542dbaf

Please sign in to comment.