altosdroid: Centralize debug printf code
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / TelemetryLogger.java
index 3ece04ac3e8596b0ef1f64b40f430e5280c13d74..7c3c2268c0ae8bf70d59ce7d654d7bfa09130eae 100644 (file)
@@ -1,18 +1,14 @@
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_1.*;
+import org.altusmetrum.altoslib_7.*;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.os.Environment;
-import android.util.Log;
 
 public class TelemetryLogger {
-       private static final String TAG = "TelemetryLogger";
-       private static final boolean D = true;
-
        private Context   context = null;
        private AltosLink link    = null;
        private AltosLog  logger  = null;
@@ -33,7 +29,7 @@ public class TelemetryLogger {
 
        private void close() {
                if (logger != null) {
-                       if (D) Log.d(TAG, "Shutting down Telemetry Logging");
+                       AltosDebug.debug("Shutting down Telemetry Logging");
                        logger.close();
                        logger = null;
                }
@@ -43,11 +39,11 @@ public class TelemetryLogger {
                String state = Environment.getExternalStorageState();
                if (Environment.MEDIA_MOUNTED.equals(state)) {
                        if (logger == null) {
-                               if (D) Log.d(TAG, "Starting up Telemetry Logging");
+                               AltosDebug.debug("Starting up Telemetry Logging");
                                logger = new AltosLog(link);
                        }
                } else {
-                       if (D) Log.d(TAG, "External Storage not present - stopping");
+                       AltosDebug.debug("External Storage not present - stopping");
                        close();
                }
        }