log Bundle
This commit is contained in:
parent
c2733fb992
commit
2d2ccde6e4
|
@ -37,6 +37,7 @@ import info.nightscout.androidaps.plugins.SourceNSClient.SourceNSClientPlugin;
|
||||||
import info.nightscout.androidaps.plugins.SourceXdrip.SourceXdripPlugin;
|
import info.nightscout.androidaps.plugins.SourceXdrip.SourceXdripPlugin;
|
||||||
import info.nightscout.androidaps.receivers.DataReceiver;
|
import info.nightscout.androidaps.receivers.DataReceiver;
|
||||||
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSDeviceStatus;
|
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSDeviceStatus;
|
||||||
|
import info.nightscout.utils.BundleLogger;
|
||||||
import info.nightscout.utils.SP;
|
import info.nightscout.utils.SP;
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +57,7 @@ public class DataService extends IntentService {
|
||||||
@Override
|
@Override
|
||||||
protected void onHandleIntent(final Intent intent) {
|
protected void onHandleIntent(final Intent intent) {
|
||||||
if (Config.logFunctionCalls)
|
if (Config.logFunctionCalls)
|
||||||
log.debug("onHandleIntent " + intent);
|
log.debug("onHandleIntent " + BundleLogger.log(intent.getExtras()));
|
||||||
|
|
||||||
if (ConfigBuilderPlugin.getActiveBgSource().getClass().equals(SourceXdripPlugin.class)) {
|
if (ConfigBuilderPlugin.getActiveBgSource().getClass().equals(SourceXdripPlugin.class)) {
|
||||||
xDripEnabled = true;
|
xDripEnabled = true;
|
||||||
|
|
21
app/src/main/java/info/nightscout/utils/BundleLogger.java
Normal file
21
app/src/main/java/info/nightscout/utils/BundleLogger.java
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package info.nightscout.utils;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mike on 14.08.2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class BundleLogger {
|
||||||
|
public static String log(Bundle bundle) {
|
||||||
|
if (bundle == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String string = "Bundle{";
|
||||||
|
for (String key : bundle.keySet()) {
|
||||||
|
string += " " + key + " => " + bundle.get(key) + ";";
|
||||||
|
}
|
||||||
|
string += " }Bundle";
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue