log (SITECHANGE)

This commit is contained in:
Milos Kozak 2018-08-24 10:36:01 +02:00
parent bed901fe15
commit 7da4e4fd70
3 changed files with 11 additions and 7 deletions

View file

@ -102,9 +102,12 @@ public class CareportalEvent implements DataPointWithLabelInterface, Interval {
return diff.get(TimeUnit.DAYS) + " " + MainApp.gs(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.gs(R.string.hours); return diff.get(TimeUnit.DAYS) + " " + MainApp.gs(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.gs(R.string.hours);
} }
public boolean isOlderThan(double hours) { return getHoursFromStart() > hours; } public boolean isOlderThan(double hours) {
return getHoursFromStart() > hours;
}
public String log() { @Override
public String toString() {
return "CareportalEvent{" + return "CareportalEvent{" +
"date= " + date + "date= " + date +
", date= " + DateUtil.dateAndTimeString(date) + ", date= " + DateUtil.dateAndTimeString(date) +
@ -136,11 +139,12 @@ public class CareportalEvent implements DataPointWithLabelInterface, Interval {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
CareportalEvent event = list.get(i); CareportalEvent event = list.get(i);
if (event.date <= time && event.date > (time - T.mins(5).msecs())) { if (event.date <= time && event.date > (time - T.mins(5).msecs())) {
//log.debug("Found event for time: " + DateUtil.dateAndTimeString(time) + " " + event.toString()); if (L.isEnabled(L.DATABASE))
log.debug("Found event for time: " + DateUtil.dateAndTimeFullString(time) + " " + event.toString());
return true; return true;
} }
} }
//log.debug("WWWWWW No found event for time: " + DateUtil.dateAndTimeString(time)); //log.debug("No found event for time: " + DateUtil.dateAndTimeString(time));
return false; return false;
} }

View file

@ -1353,7 +1353,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
if (list.size() == 1) { if (list.size() == 1) {
CareportalEvent record = list.get(0); CareportalEvent record = list.get(0);
if (L.isEnabled(L.DATABASE)) if (L.isEnabled(L.DATABASE))
log.debug("Removing CareportalEvent record from database: " + record.log()); log.debug("Removing CareportalEvent record from database: " + record.toString());
delete(record); delete(record);
} else { } else {
if (L.isEnabled(L.DATABASE)) if (L.isEnabled(L.DATABASE))

View file

@ -254,7 +254,7 @@ public class DataService extends IntentService {
CareportalEvent careportalEvent = new CareportalEvent(nsMbg); CareportalEvent careportalEvent = new CareportalEvent(nsMbg);
MainApp.getDbHelper().createOrUpdate(careportalEvent); MainApp.getDbHelper().createOrUpdate(careportalEvent);
if (L.isEnabled(L.DATASERVICE)) if (L.isEnabled(L.DATASERVICE))
log.debug("Adding/Updating new MBG: " + careportalEvent.log()); log.debug("Adding/Updating new MBG: " + careportalEvent.toString());
} }
} }