OBJECTIVES logging
This commit is contained in:
parent
cfff357e6b
commit
8a66b4db2e
|
@ -44,6 +44,7 @@ public class Config {
|
|||
public static final boolean logDataFood = true;
|
||||
public static final boolean logDataTreatments = true;
|
||||
public static final boolean logNsclient = true;
|
||||
public static final boolean logObjectives = false;
|
||||
|
||||
// DanaR specific
|
||||
public static final boolean logDanaBTComm = true;
|
||||
|
|
|
@ -80,4 +80,5 @@ public class Constants {
|
|||
public static final String DATAFOOD = "DATAFOOD";
|
||||
public static final String DATATREATMENTS = "DATATREATMENTS";
|
||||
public static final String NSCLIENT = "NSCLIENT";
|
||||
public static final String OBJECTIVES = "OBJECTIVES";
|
||||
}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.ConstraintsObjectives;
|
||||
|
||||
import android.animation.LayoutTransition;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.LinearSmoothScroller;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.Html;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -21,28 +18,15 @@ import android.widget.CheckBox;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.events.EventConfigBuilderChange;
|
||||
import info.nightscout.androidaps.events.EventNewBG;
|
||||
import info.nightscout.androidaps.events.EventProfileSwitchChange;
|
||||
import info.nightscout.androidaps.events.EventTreatmentChange;
|
||||
import info.nightscout.androidaps.plugins.Common.SubscriberFragment;
|
||||
import info.nightscout.androidaps.plugins.ConstraintsObjectives.events.EventObjectivesSaved;
|
||||
import info.nightscout.androidaps.plugins.ConstraintsObjectives.objectives.Objective;
|
||||
import info.nightscout.utils.FabricPrivacy;
|
||||
|
||||
public class ObjectivesFragment extends SubscriberFragment {
|
||||
private static Logger log = LoggerFactory.getLogger(ObjectivesFragment.class);
|
||||
|
||||
RecyclerView recyclerView;
|
||||
CheckBox enableFake;
|
||||
TextView reset;
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.Config;
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.interfaces.Constraint;
|
||||
|
@ -32,7 +33,7 @@ import info.nightscout.utils.SP;
|
|||
* Created by mike on 05.08.2016.
|
||||
*/
|
||||
public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface {
|
||||
private static Logger log = LoggerFactory.getLogger(ObjectivesPlugin.class);
|
||||
private static Logger log = LoggerFactory.getLogger(Constants.OBJECTIVES);
|
||||
|
||||
private static ObjectivesPlugin objectivesPlugin;
|
||||
|
||||
|
@ -94,7 +95,7 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface
|
|||
SP.putBoolean("Objectives" + "bgIsAvailableInNS", bgIsAvailableInNS);
|
||||
SP.putBoolean("Objectives" + "pumpStatusIsAvailableInNS", pumpStatusIsAvailableInNS);
|
||||
SP.putString("Objectives" + "manualEnacts", Integer.toString(manualEnacts));
|
||||
if (Config.logPrefsChange)
|
||||
if (Config.logObjectives)
|
||||
log.debug("Objectives stored");
|
||||
MainApp.bus().post(new EventObjectivesSaved());
|
||||
}
|
||||
|
@ -107,7 +108,7 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface
|
|||
} catch (Exception e) {
|
||||
log.error("Unhandled exception", e);
|
||||
}
|
||||
if (Config.logPrefsChange)
|
||||
if (Config.logObjectives)
|
||||
log.debug("Objectives loaded");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue