From 7da4e4fd70a89e545086a488caaf43869547b5ae Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 24 Aug 2018 10:36:01 +0200 Subject: [PATCH] log (SITECHANGE) --- .../nightscout/androidaps/db/CareportalEvent.java | 14 +++++++++----- .../nightscout/androidaps/db/DatabaseHelper.java | 2 +- .../androidaps/services/DataService.java | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java index e7fd6c99e9..e6098cee54 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java @@ -97,14 +97,17 @@ public class CareportalEvent implements DataPointWithLabelInterface, Interval { public String age() { Map diff = computeDiff(date, System.currentTimeMillis()); if (OverviewFragment.shorttextmode) - return diff.get(TimeUnit.DAYS) +"d" + diff.get(TimeUnit.HOURS) + "h"; + return diff.get(TimeUnit.DAYS) + "d" + diff.get(TimeUnit.HOURS) + "h"; else 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{" + "date= " + date + ", date= " + DateUtil.dateAndTimeString(date) + @@ -136,11 +139,12 @@ public class CareportalEvent implements DataPointWithLabelInterface, Interval { for (int i = 0; i < list.size(); i++) { CareportalEvent event = list.get(i); 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; } } - //log.debug("WWWWWW No found event for time: " + DateUtil.dateAndTimeString(time)); + //log.debug("No found event for time: " + DateUtil.dateAndTimeString(time)); return false; } diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index e73a8dae17..75de0cb372 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -1353,7 +1353,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { if (list.size() == 1) { CareportalEvent record = list.get(0); 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); } else { if (L.isEnabled(L.DATABASE)) diff --git a/app/src/main/java/info/nightscout/androidaps/services/DataService.java b/app/src/main/java/info/nightscout/androidaps/services/DataService.java index 9660031e0b..6edd49c0ed 100644 --- a/app/src/main/java/info/nightscout/androidaps/services/DataService.java +++ b/app/src/main/java/info/nightscout/androidaps/services/DataService.java @@ -254,7 +254,7 @@ public class DataService extends IntentService { CareportalEvent careportalEvent = new CareportalEvent(nsMbg); MainApp.getDbHelper().createOrUpdate(careportalEvent); if (L.isEnabled(L.DATASERVICE)) - log.debug("Adding/Updating new MBG: " + careportalEvent.log()); + log.debug("Adding/Updating new MBG: " + careportalEvent.toString()); } }